..['mystr', 'mystr', '', '']
['myarray[1]', 'myarray', '[1]', '1']
['assoc[name]', 'assoc', '[name]', 'name']
(command.Simple
  blame_tok: <Id.Lit_Chars ls>
  more_env: []
  words: [{<Id.Lit_Chars ls>} {<Id.Lit_Chars foo>}]
  is_last_cmd: F
)


	ls [$x] $y core/a*.py
(command.Simple
  blame_tok: <Id.Lit_Chars ls>
  more_env: []
  words: [
    {<Id.Lit_Chars ls>}
    {<Id.Lit_LBracket "["> ($ x) <Id.Lit_RBracket "]">}
    {($ y)}
    {<Id.Lit_Chars core> <Id.Lit_Slash /> <Id.Lit_Chars a> <Id.Lit_Star "*"> <Id.Lit_Chars .py>}
  ]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Argv
  argv: [ls "[-" -- "---]" y yy core/alloc.py core/alloc_test.py]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 2
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "ls [$x] $y core/a*.py"
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: ls
        )
      ]
    )
    (CompoundWord
      parts: [
        (Token id:Id.Lit_LBracket length:1 col:3 line:...0x7f340f7b4f70 tval:"[")
        (SimpleVarSub
          tok: (Token id:Id.VSub_DollarName length:2 col:4 line:...0x7f340f7b4f70 tval:x)
        )
        (Token id:Id.Lit_RBracket length:1 col:6 line:...0x7f340f7b4f70 tval:"]")
      ]
    )
    ...0x7f340f963050
    ...0x7f340f963050
    ...0x7f340f963050
    (CompoundWord
      parts: [
        (SimpleVarSub
          tok: (Token id:Id.VSub_DollarName length:2 col:8 line:...0x7f340f7b4f70 tval:y)
        )
      ]
    )
    ...0x7f340f9621b8
    (CompoundWord
      parts: [
        (Token id:Id.Lit_Chars length:4 col:11 line:...0x7f340f7b4f70 tval:core)
        (Token id:Id.Lit_Slash length:1 col:15 line:...0x7f340f7b4f70 tval:/)
        (Token id:Id.Lit_Chars length:1 col:16 line:...0x7f340f7b4f70 tval:a)
        (Token id:Id.Lit_Star length:1 col:17 line:...0x7f340f7b4f70 tval:"*")
        (Token id:Id.Lit_Chars length:3 col:18 line:...0x7f340f7b4f70 tval:.py)
      ]
    )
    ...0x7f340f9622d8
  ]
  is_last_cmd: F
)


	local a=1
(command.Simple
  blame_tok: <Id.Lit_Chars local>
  more_env: []
  words: [{<Id.Lit_Chars local>} {<Id.Lit_VarLike "a="> <Id.Lit_Chars 1>}]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 11
  argv: [local]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 5
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "local a=1"
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: local
        )
      ]
    )
  ]
  pairs: [
    (AssignArg
      var_name: a
      rval: (value.Str s:1)
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (Token id:Id.Lit_VarLike length:2 col:6 line:...0x7f340f7b4f18)
            (Token id:Id.Lit_Chars length:1 col:8 line:...0x7f340f7b4f18 tval:1)
          ]
        )
    )
  ]
)


	builtin local a=1
(command.Simple
  blame_tok: <Id.Lit_Chars builtin>
  more_env: []
  words: [{<Id.Lit_Chars builtin>} {<Id.Lit_Chars local>} {<Id.Lit_VarLike "a="> <Id.Lit_Chars 1>}]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 11
  argv: [local]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 7
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "builtin local a=1"
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: builtin
        )
      ]
    )
  ]
  pairs: [
    (AssignArg
      var_name: a
      rval: (value.Str s:1)
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (Token id:Id.Lit_VarLike length:2 col:14 line:...0x7f340f7b4f70)
            (Token id:Id.Lit_Chars length:1 col:16 line:...0x7f340f7b4f70 tval:1)
          ]
        )
    )
  ]
)


	command local a=1
(command.Simple
  blame_tok: <Id.Lit_Chars command>
  more_env: []
  words: [{<Id.Lit_Chars command>} {<Id.Lit_Chars local>} {<Id.Lit_VarLike "a="> <Id.Lit_Chars 1>}]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 11
  argv: [local]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 7
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "command local a=1"
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: command
        )
      ]
    )
  ]
  pairs: [
    (AssignArg
      var_name: a
      rval: (value.Str s:1)
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (Token id:Id.Lit_VarLike length:2 col:14 line:...0x7f340f7b4f18)
            (Token id:Id.Lit_Chars length:1 col:16 line:...0x7f340f7b4f18 tval:1)
          ]
        )
    )
  ]
)


	typeset -"$@"
(command.Simple
  blame_tok: <Id.Lit_Chars typeset>
  more_env: []
  words: [{<Id.Lit_Chars typeset>} {<Id.Lit_Chars -> (DQ ($ Id.VSub_At))}]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 13
  argv: [typeset -x]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 7
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "typeset -\"$@\""
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: typeset
        )
      ]
    )
    (CompoundWord
      parts: [
        (Token id:Id.Lit_Chars length:1 col:8 line:...0x7f340f7b4f70 tval:-)
        (DoubleQuoted
          left: (Token id:Id.Left_DoubleQuote length:1 col:9 line:...0x7f340f7b4f70)
          parts: [(SimpleVarSub tok:(Token id:Id.VSub_At length:2 col:10 line:...0x7f340f7b4f70))]
          right: (Token id:Id.Right_DoubleQuote length:1 col:12 line:...0x7f340f7b4f70)
        )
      ]
    )
  ]
  pairs: [
    (AssignArg var_name:foo plus_eq:F blame_word:...0x7f340f7b8f38)
    (AssignArg var_name:spam rval:(value.Str s:eggs) plus_eq:F blame_word:...0x7f340f7b8f38)
  ]
)


	local a=(1 2) "$@"
(command.Simple
  blame_tok: <Id.Lit_Chars local>
  more_env: []
  words: [
    {<Id.Lit_Chars local>}
    {<Id.Lit_VarLike "a="> 
      (ShArrayLiteral
        left: <Id.Op_LParen "(">
        words: [{<Id.Lit_Chars 1>} {<Id.Lit_Chars 2>}]
        right: <Id.Right_ShArrayLiteral ")">
      )
    }
    {(DQ ($ Id.VSub_At))}
  ]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 11
  argv: [local]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 5
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "local a=(1 2) \"$@\""
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: local
        )
      ]
    )
  ]
  pairs: [
    (AssignArg
      var_name: a
      rval: (value.BashArray strs:[1 2])
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (Token id:Id.Lit_VarLike length:2 col:6 line:...0x7f340f7b4f18)
            (ShArrayLiteral
              left: (Token id:Id.Op_LParen length:1 col:8 line:...0x7f340f7b4f18)
              words: [
                (CompoundWord
                  parts: [(Token id:Id.Lit_Chars length:1 col:9 line:...0x7f340f7b4f18 tval:1)]
                )
                (CompoundWord
                  parts: [(Token id:Id.Lit_Chars length:1 col:11 line:...0x7f340f7b4f18 tval:2)]
                )
              ]
              right: (Token id:Id.Right_ShArrayLiteral length:1 col:12 line:...0x7f340f7b4f18)
            )
          ]
        )
    )
    (AssignArg
      var_name: x
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (DoubleQuoted
              left: (Token id:Id.Left_DoubleQuote length:1 col:14 line:...0x7f340f7b4f18)
              parts: [(SimpleVarSub tok:(Token id:Id.VSub_At length:2 col:15 line:...0x7f340f7b4f18))]
              right: (Token id:Id.Right_DoubleQuote length:1 col:17 line:...0x7f340f7b4f18)
            )
          ]
        )
    )
    (AssignArg var_name:foo plus_eq:F blame_word:...0x7f340f7d77e8)
    (AssignArg var_name:spam rval:(value.Str s:eggs) plus_eq:F blame_word:...0x7f340f7d77e8)
  ]
)


	readonly "$@" a=(1 2)
(command.Simple
  blame_tok: <Id.Lit_Chars readonly>
  more_env: []
  words: [
    {<Id.Lit_Chars readonly>}
    {(DQ ($ Id.VSub_At))}
    {<Id.Lit_VarLike "a="> 
      (ShArrayLiteral
        left: <Id.Op_LParen "(">
        words: [{<Id.Lit_Chars 1>} {<Id.Lit_Chars 2>}]
        right: <Id.Right_ShArrayLiteral ")">
      )
    }
  ]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 10
  argv: [readonly]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 8
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "readonly \"$@\" a=(1 2)"
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: readonly
        )
      ]
    )
  ]
  pairs: [
    (AssignArg
      var_name: x
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (DoubleQuoted
              left: (Token id:Id.Left_DoubleQuote length:1 col:9 line:...0x7f340f7b4f70)
              parts: [(SimpleVarSub tok:(Token id:Id.VSub_At length:2 col:10 line:...0x7f340f7b4f70))]
              right: (Token id:Id.Right_DoubleQuote length:1 col:12 line:...0x7f340f7b4f70)
            )
          ]
        )
    )
    (AssignArg var_name:foo plus_eq:F blame_word:...0x7f340f962c68)
    (AssignArg var_name:spam rval:(value.Str s:eggs) plus_eq:F blame_word:...0x7f340f962c68)
    (AssignArg
      var_name: a
      rval: (value.BashArray strs:[1 2])
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (Token id:Id.Lit_VarLike length:2 col:14 line:...0x7f340f7b4f70)
            (ShArrayLiteral
              left: (Token id:Id.Op_LParen length:1 col:16 line:...0x7f340f7b4f70)
              words: [
                (CompoundWord
                  parts: [(Token id:Id.Lit_Chars length:1 col:17 line:...0x7f340f7b4f70 tval:1)]
                )
                (CompoundWord
                  parts: [(Token id:Id.Lit_Chars length:1 col:19 line:...0x7f340f7b4f70 tval:2)]
                )
              ]
              right: (Token id:Id.Right_ShArrayLiteral length:1 col:20 line:...0x7f340f7b4f70)
            )
          ]
        )
    )
  ]
)


	declare -rx foo=bar spam=eggs a=(1 2)
(command.Simple
  blame_tok: <Id.Lit_Chars declare>
  more_env: []
  words: [
    {<Id.Lit_Chars declare>}
    {<Id.Lit_Chars -rx>}
    {<Id.Lit_VarLike "foo="> <Id.Lit_Chars bar>}
    {<Id.Lit_VarLike "spam="> <Id.Lit_Chars eggs>}
    {<Id.Lit_VarLike "a="> 
      (ShArrayLiteral
        left: <Id.Op_LParen "(">
        words: [{<Id.Lit_Chars 1>} {<Id.Lit_Chars 2>}]
        right: <Id.Right_ShArrayLiteral ")">
      )
    }
  ]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 12
  argv: [declare -rx]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 7
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "declare -rx foo=bar spam=eggs a=(1 2)"
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: declare
        )
      ]
    )
    (CompoundWord parts:[(Token id:Id.Lit_Chars length:3 col:8 line:...0x7f340f7b4f18 tval:-rx)])
  ]
  pairs: [
    (AssignArg
      var_name: foo
      rval: (value.Str s:bar)
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (Token id:Id.Lit_VarLike length:4 col:12 line:...0x7f340f7b4f18)
            (Token id:Id.Lit_Chars length:3 col:16 line:...0x7f340f7b4f18 tval:bar)
          ]
        )
    )
    (AssignArg
      var_name: spam
      rval: (value.Str s:eggs)
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (Token id:Id.Lit_VarLike length:5 col:20 line:...0x7f340f7b4f18)
            (Token id:Id.Lit_Chars length:4 col:25 line:...0x7f340f7b4f18 tval:eggs)
          ]
        )
    )
    (AssignArg
      var_name: a
      rval: (value.BashArray strs:[1 2])
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (Token id:Id.Lit_VarLike length:2 col:30 line:...0x7f340f7b4f18)
            (ShArrayLiteral
              left: (Token id:Id.Op_LParen length:1 col:32 line:...0x7f340f7b4f18)
              words: [
                (CompoundWord
                  parts: [(Token id:Id.Lit_Chars length:1 col:33 line:...0x7f340f7b4f18 tval:1)]
                )
                (CompoundWord
                  parts: [(Token id:Id.Lit_Chars length:1 col:35 line:...0x7f340f7b4f18 tval:2)]
                )
              ]
              right: (Token id:Id.Right_ShArrayLiteral length:1 col:36 line:...0x7f340f7b4f18)
            )
          ]
        )
    )
  ]
)


	declare $binding
(command.Simple
  blame_tok: <Id.Lit_Chars declare>
  more_env: []
  words: [{<Id.Lit_Chars declare>} {($ binding)}]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 12
  argv: [declare]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 7
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "declare $binding"
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: declare
        )
      ]
    )
  ]
  pairs: [
    (AssignArg
      var_name: spam
      rval: (value.Str s:eggs)
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (SimpleVarSub
              tok: (Token id:Id.VSub_DollarName length:8 col:8 line:...0x7f340f7b4fc8 tval:binding)
            )
          ]
        )
    )
  ]
)


	declare $binding_with_spaces
(command.Simple
  blame_tok: <Id.Lit_Chars declare>
  more_env: []
  words: [{<Id.Lit_Chars declare>} {($ binding_with_spaces)}]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 12
  argv: [declare]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 7
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "declare $binding_with_spaces"
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: declare
        )
      ]
    )
  ]
  pairs: [
    (AssignArg
      var_name: x
      rval: (value.Str s:"green eggs and ham")
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (SimpleVarSub
              tok: 
                (Token
                  id: Id.VSub_DollarName
                  length: 20
                  col: 8
                  line: ...0x7f340f7b4f18
                  tval: binding_with_spaces
                )
            )
          ]
        )
    )
  ]
)


	export a=(1 2)
(command.Simple
  blame_tok: <Id.Lit_Chars export>
  more_env: []
  words: [
    {<Id.Lit_Chars export>}
    {<Id.Lit_VarLike "a="> 
      (ShArrayLiteral
        left: <Id.Op_LParen "(">
        words: [{<Id.Lit_Chars 1>} {<Id.Lit_Chars 2>}]
        right: <Id.Right_ShArrayLiteral ")">
      )
    }
  ]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 14
  argv: [export]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 6
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "export a=(1 2)"
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: export
        )
      ]
    )
  ]
  pairs: [
    (AssignArg
      var_name: a
      rval: (value.BashArray strs:[1 2])
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (Token id:Id.Lit_VarLike length:2 col:7 line:...0x7f340f7b4fc8)
            (ShArrayLiteral
              left: (Token id:Id.Op_LParen length:1 col:9 line:...0x7f340f7b4fc8)
              words: [
                (CompoundWor..
----------------------------------------------------------------------
Ran 4 tests in 0.024s

OK
d
                  parts: [(Token id:Id.Lit_Chars length:1 col:10 line:...0x7f340f7b4fc8 tval:1)]
                )
                (CompoundWord
                  parts: [(Token id:Id.Lit_Chars length:1 col:12 line:...0x7f340f7b4fc8 tval:2)]
                )
              ]
              right: (Token id:Id.Right_ShArrayLiteral length:1 col:13 line:...0x7f340f7b4fc8)
            )
          ]
        )
    )
  ]
)


	export A=(["k"]=v)
(command.Simple
  blame_tok: <Id.Lit_Chars export>
  more_env: []
  words: [
    {<Id.Lit_Chars export>}
    {<Id.Lit_VarLike "A="> 
      (word_part.BashAssocLiteral
        left: <Id.Op_LParen "(">
        pairs: [(AssocPair key:{(DQ <Id.Lit_Chars k>)} value:{<Id.Lit_Chars v>})]
        right: <Id.Right_ShArrayLiteral ")">
      )
    }
  ]
  is_last_cmd: F
)
	cmd_value:
(cmd_value.Assign
  builtin_id: 14
  argv: [export]
  arg_locs: [
    (CompoundWord
      parts: [
        (Token
          id: Id.Lit_Chars
          length: 6
          col: 0
          line: 
            (SourceLine
              line_num: 1
              content: "export A=([\"k\"]=v)"
              src: (source.MainFile path:"<cmd_parse_test>")
            )
          tval: export
        )
      ]
    )
  ]
  pairs: [
    (AssignArg
      var_name: A
      rval: (value.BashAssoc d:[Dict k v])
      plus_eq: F
      blame_word: 
        (CompoundWord
          parts: [
            (Token id:Id.Lit_VarLike length:2 col:7 line:...0x7f340f7b4f18)
            (word_part.BashAssocLiteral
              left: (Token id:Id.Op_LParen length:1 col:9 line:...0x7f340f7b4f18)
              pairs: [
                (AssocPair
                  key: 
                    (CompoundWord
                      parts: [
                        (DoubleQuoted
                          left: (Token id:Id.Left_DoubleQuote length:1 col:11 line:...0x7f340f7b4f18)
                          parts: [
                            (Token
                              id: Id.Lit_Chars
                              length: 1
                              col: 12
                              line: ...0x7f340f7b4f18
                              tval: k
                            )
                          ]
                          right: 
                            (Token
                              id: Id.Right_DoubleQuote
                              length: 1
                              col: 13
                              line: ...0x7f340f7b4f18
                            )
                        )
                      ]
                    )
                  value: 
                    (CompoundWord
                      parts: [(Token id:Id.Lit_Chars length:1 col:16 line:...0x7f340f7b4f18 tval:v)]
                    )
                )
              ]
              right: (Token id:Id.Right_ShArrayLiteral length:1 col:17 line:...0x7f340f7b4f18)
            )
          ]
        )
    )
  ]
)


	readonly a[x]=1
(command.Simple
  blame_tok: <Id.Lit_Chars readonly>
  more_env: []
  words: [
    {<Id.Lit_Chars readonly>}
    {<Id.Lit_ArrayLhsOpen "a["> <Id.Lit_Chars x> <Id.Lit_ArrayLhsClose "]="> <Id.Lit_Chars 1>}
  ]
  is_last_cmd: F
)
	readonly $binding a[x]=1
(command.Simple
  blame_tok: <Id.Lit_Chars readonly>
  more_env: []
  words: [
    {<Id.Lit_Chars readonly>}
    {($ binding)}
    {<Id.Lit_ArrayLhsOpen "a["> <Id.Lit_Chars x> <Id.Lit_ArrayLhsClose "]="> <Id.Lit_Chars 1>}
  ]
  is_last_cmd: F
)
	declare $empty
(command.Simple
  blame_tok: <Id.Lit_Chars declare>
  more_env: []
  words: [{<Id.Lit_Chars declare>} {($ empty)}]
  is_last_cmd: F
)