Skip to content
jc-rs
GitHub

typeset

--typesetv1.0.0

`typeset` and `declare` command parser

command
$ cat input.txt | jc-rs --typeset

A real pair

From the reference corpus (generic/typeset--capital-a.json). The left pane is the input the fixture ships; the right pane is the corpus's expected JSON. CI compares jc-rs with it field by field under the published differential. Hover a value to see where it came from.

typesetgeneric
declare -A BASH_ALIASES=()
declare -A BASH_CMDS=()
declare -A associative_array=([key2]="abc" [key3]="1 2 3" [key1]="hello \"world\"" )
declare -Ai integers_associative_array=([one]="1" [two]="500" [three]="999" )
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
[
  {
    "name": "BASH_ALIASES",
    "value": [],
    "type": "associative",
    "readonly": false,
    "integer": false,
    "lowercase": false,
    "uppercase": false,
    "exported": false
  },
  {
    "name": "BASH_CMDS",
    "value": [],
    "type": "associative",
    "readonly": false,
    "integer": false,
    "lowercase": false,
    "uppercase": false,
    "exported": false
  },
  {
    "name": "associative_array",
    "value": {
      "key2": "abc",
      "key3": "1 2 3",
      "key1": "hello \"world\""
    },
    "type": "associative",
    "readonly": false,
    "integer": false,
    "lowercase": false,
    "uppercase": false,
    "exported": false
  },
  {
    "name": "integers_associative_array",
    "value": {
      "one": 1,
      "two": 500,
      "three": 999
    },
    "type": "associative",
    "readonly": false,
    "integer": true,
    "lowercase": false,
    "uppercase": false,
    "exported": false
  }
]

Fixture coverage

5/5oracle-valid pairs match under the published structural JSON comparison

Magic syntax

not availableThis parser reads a file or a string rather than a command, so there is nothing for jc-rs to run. Pipe it in.

Source: crates/jc-rs-parsers/src/misc/typeset.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare