array=(a b c) ls ^~~~~~ '':1: Environment bindings can't contain array literals .....(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:empty) op: Equal rhs: {(sh_array_literal left:)} ) ] ) ] )(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:array) op: Equal rhs: {(sh_array_literal left: words:[{(a)} {(b)} {(c)}])} ) ] ) ] )(command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:array) op: Equal rhs: {(sh_array_literal left: words:[{(a)} {(b)} {(c)}])} ) ] ) terminator: ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:array2) op: Equal rhs: {(sh_array_literal left: words:[{(d)} {(e)} {(f)}])} ) ] ) ] )(C {(ls)} {(foo)})(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F)(command.AndOr ops:[Op_DPipe] children:[(C {(ls)} {(foo)}) (C {(die)})])(command.AndOr ops: [Op_DPipe] children: [(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)})] )(command.Case to_match:{(foo)})(command.Case to_match: {(word)} arms: [(case_arm pat_list:[{(foo)} {(foo2)} {(foo3)}] action:[(C {(echo)} {(hi)})])] )(command.Case to_match: {(word)} arms: [(case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(one-line)})])] )(command.Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})]) (case_arm pat_list:[{(bar)}] action:[(C {(echo)} {(bar)})]) ] )(command.Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})]) (case_arm pat_list: [{(bar)}] action: [(command.Sentence child:(C {(echo)} {(bar)}) terminator:)] ) ] )(command.Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})]) (case_arm pat_list:[{(bar)}] action:[(C {(echo)} {(bar)})]) ] )(command.Simple words: [ (word.Compound parts:[(word_part.Literal token:(token id:Lit_Chars val:ls span_id:0))]) (word.Compound parts:[(word_part.Literal token:(token id:Lit_Chars val:foo span_id:2))]) ] ) (command.ShFunction name: fun body: (command.BraceGroup children: [ (command.Sentence child: (command.Simple words: [ (word.Compound parts: [(word_part.Literal token:(token id:Lit_Chars val:echo span_id:6))] ) (word.Compound parts: [(word_part.Literal token:(token id:Lit_Chars val:hi span_id:8))] ) ] ) terminator: (token id:Op_Semi val:';' span_id:9) ) ] ) ) (C {(echo)} { (command_sub left_token: command_list: (command.CommandList children:[(C {(echo)} {(12)})]) ) (command_sub left_token: command_list: (command.CommandList children:[(C {(echo)} {(34)})]) ) } )(C {(echo)} { (DQ (command_sub left_token: command_list: (command.CommandList children:[(C {(echo)} {(12)})]) ) (command_sub left_token: command_list: (command.CommandList children:[(C {(echo)} {(34)})]) ) ) } )(command.CommandList children: [ (command.DBracket expr: (bool_expr.Binary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}) ) ] )(command.CommandList children: [ (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}) .....right: (bool_expr.WordTest w:{(foo)}) ) ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.DBracket expr: (bool_expr.Binary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}) ) ] action: [(C {(echo)} {(hi)})] ) ] ) ] )(command.CommandList children: [ (command.DBracket expr: (bool_expr.Binary op_id:BoolBinary_EqualTilde left:{(foo)} right:{(foo)}) ) ] )(command.CommandList children: [ (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_EqualTilde left: {(foo)} right: {(Lit_Other '(') (foo) (Lit_Other '|') (bar) (Lit_Other ')')} ) ) ] )(command.CommandList children: [ (command.DParen child: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithWord w:{(Lit_Digits 2)}) ) ) ] )(command.CommandList children: [ (command.ForEach iter_name: i iter_words: [{(1)} {(2)} {(3)}] do_arg_iter: F body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})]) ) ] )(command.CommandList children: [ (command.ForEach iter_name: i do_arg_iter: F body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})]) ) ] )(command.CommandList children: [ (command.ForEach iter_name: i do_arg_iter: T body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ VSub_DollarName '$i')}) terminator: ) ] ) ) ] )(command.CommandList children: [ (command.ForEach iter_name: i do_arg_iter: T body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})]) ) ] )(command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 5)}) ) update: (arith_expr.UnaryAssign op_id:Arith_DPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})]) ) ] )(command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 5)}) ) update: (arith_expr.UnaryAssign op_id:Arith_DPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})]) ) ] )(command.CommandList children: [ (command.ForExpr body:(command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})])) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.Subshell command_list:(command.CommandList children:[(C {(echo)} {(hi)})])) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence ... ls foo| ^ '':1: Unexpected EOF while parsing command ... child: (C {(echo)} {($ VSub_DollarName '$i')}) terminator: ) ] ) ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.Subshell command_list:(command.CommandList children:[(C {(echo)} {(hi)})])) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ VSub_DollarName '$i')}) terminator: ) ] ) ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ VSub_DollarName '$i')}) terminator: ) ] ) ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] ) redirects: [ (redir.Redir op:&'> fd:1 arg_word:{(2)}) (redir.Redir op:'> fd:2 arg_word:{(/dev/null)}) ] ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(true)}) terminator:)] action: [(command.Sentence child:(C {(echo)} {(yes)}) terminator:)] ) ] ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Subshell command_list:(command.CommandList children:[(C {(true)})])) terminator: ) ] action: [(command.Sentence child:(C {(echo)} {(yes)}) terminator:)] ) ] ) ] )(command.CommandList children:[(C {(ifFOO)})])(C {(ls)} {(foo)})(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F)(command.Pipeline children:[(C {(echo)} {(foo)}) (C {(grep)} {(foo)})] negated:T)(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)}) (C {(less)})] negated:F)(command.CommandList children: [ (command.Pipeline children:[(C {(ls)}) (C {(cat)}) (C {(cat)})] negated:F stderr_indices:[1]) ] )(command.CommandList children: [ (command.Pipeline children:[(C {(ls)}) (C {(cat)}) (C {(cat)})] negated:F stderr_indices:[0]) ] )(command.CommandList children: [ (command.Pipeline children: [(C {(ls)}) (C {(cat)}) (C {(cat)})] negated: F stderr_indices: [0 1] ) ] )(command.CommandList children: [ (C {(ls)} {(word_part.TildeSub token:)} {(word_part.TildeSub token:)} {(word_part.TildeSub token:) (/src)} {(word_part.TildeSub token:) (/src/foo)} {(word_part.TildeSub token:) (/src)} {(Lit_TildeLike '~weird') (KW_Bang '!') (name/blah) (KW_Bang '!') (blah)} ) ] )(command.CommandList children: [ (command.WhileUntil .... (( 1 + )) ^ '':1: Token can't be used in prefix position . A= (1 2) ^ '':1: Expected ( after =, got ' ' . [[ foo bar ]] ^~~ '':1: Expected ]] [[ foo -eq ]] ^ '':1: Expected ]] [[ foo$(echo <) -eq foo ]] ^ '':1: Invalid token after redirect operator . ls < ^ '':1: Invalid token after redirect operator ls < < ^ '':1: Invalid token after redirect operator echo foo$(ls <)bar ^ '':1: Invalid token after redirect operator BAD_ENV=(1 2 3) ls ^~~~~~~~ '':1: Environment bindings can't contain array literals for ((i=1; i<)); do echo $i; done ^ '':1: Token can't be used in prefix position for ((i=1; i<5; ++i)) OOPS echo $i; ERR ^~~~ '':1: Invalid word after for expression for ((i=1; i<5; ++i)); OOPS echo $i; ERR ^~~~ '':1: Expected word type , got for $bad in 1 2; do echo hi; done ^~~~ '':1: Loop variable name should be a constant for foo BAD ^~~ '':1: Unexpected word after for loop variable if foo; then echo hi; z ^ '':1: Expected word type , got foo$(invalid) () { echo hi; } ^~~ '':1: Invalid function name . foo="" echo "bar ^ '':1: Unexpected EOF reading double-quoted string that began here .. for x in 1 2 $( ^ '':1: Invalid word in for loop . for [ i = 1; i < 10; i++ ] ^ '':1: Invalid loop variable name for = in a ^ '':1: Invalid loop variable name . for x in 1 2 $(cat <':1: Couldn't find terminator for here doc that starts here . foo"bar" () { ^~~ '':1: Invalid function name .. keyword: cond: [(command.Sentence child:(C {(false)}) terminator:)] body: (command.DoGroup children: [(C {(echo)} {(hi)}) (command.ControlFlow token:)] ) ) ] )(command.CommandList children: [ (command.WhileUntil keyword: cond: [(command.Sentence child:(C {(true)}) terminator:)] body: (command.DoGroup children: [(C {(echo)} {(hi)}) (command.ControlFlow token:)] ) ) ] )(command.CommandList children: [ (command.WhileUntil keyword: cond: [(C {(true)})] body: (command.DoGroup children: [(C {(echo)} {(hi)}) (command.ControlFlow token:)] ) ) ] )(command.Simple words: [{(ls)} {(foo)}] redirects: [(redir.Redir op:'> fd:2 arg_word:{(/dev/null)})] )(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F)(command.AndOr ops: [Op_DPipe] children: [(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)})] )(command.CommandList children: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)}) ] ) terminator: ) (C {(ls)} {(/)}) ] )(command.CommandList children:[(C {(ls)} {(foo)})])(command.CommandList children: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)}) ] ) terminator: ) (C {(ls)} {(/)}) ] )(command.CommandList children: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(echo)} {(fail)}) ] ) terminator: ) (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children:[(C {(echo)} {(bar)}) (C {(wc)} {(-c)})] negated:F) (C {(echo)} {(f2)}) ] ) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 17 stdin_parts: [ ('1 ') (command_sub left_token: command_list: (command.CommandList children:[(C {(echo)} {(2)}) (C {(echo)} {(3)})]) ) (' 4\n') ] ) ] )(command.AndOr ops: [Op_DPipe] children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(echo)} {(hi)}) ] )(command.AndOr ops: [Op_DAmp] children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 14 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(echo)} {(hi)}) ] )(command.AndOr ops: [Op_DAmp] children: [ (command.Simple words: [{(tac)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF1)} here_end_span_id: 15 stdin_parts: [('PIPE A1\n') ('PIPE A2\n')] ) ] ) (command.Simple words: [{(tac)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF2)} here_end_span_id: 19 ........ stdin_parts: [('PIPE B1\n') ('PIPE B2\n')] ) ] ) ] )(command.Pipeline children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 12 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(tac)}) ] negated: F )(command.Pipeline children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(tac)}) ] negated: F )(command.CommandList children: [ (command.Sentence child: (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) terminator: ) (C {(echo)} {(hi)}) ] )(command.CommandList children: [ (command.Sentence child: (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 14 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) terminator: ) (C {(echo)} {(hi)}) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('one tab then foo: ') ($ VSub_DollarName '$foo') ('\n')] ) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(DQ (EOF))} here_end_span_id: 9 stdin_parts: [('$v\n') ('"two\n')] ) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(SQ )} here_end_span_id: 8 stdin_parts: [('single-quoted: $var\n')] ) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EO) (word_part.EscapedLiteral token:)} here_end_span_id: 8 stdin_parts: [('single-quoted: $var\n')] ) ] )(command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF1)} here_end_span_id: 15 stdin_parts: [('PIPE A1\n') ('PIPE A2\n')] ) ] ) (command.Simple words: [{(tac)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF2)} here_end_span_id: 19 stdin_parts: [('PIPE B1\n') ('PIPE B2\n')] ) ] ) ] negated: F ) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [($ VSub_DollarName '$v') ('\n') (Right_DoubleQuote '"') ('two\n')] ) ] )(C {(echo)} { (command_sub left_token: command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Star left: (arith_ex...pr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) ) ) } ) ] ) ) } )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) ) ) } ) ] ) ) ] )(C {(echo)} { (command_sub left_token: command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithWord w:{(Lit_Digits 2)}) ) ) } ) ] ) ) } )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithWord w:{(Lit_Digits 2)}) ) ) } ) ] ) ) ] )(command.CommandList children: [ (C {(echo)} { (command_sub left_token: command_list: (command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:array) op: Equal rhs: {(sh_array_literal left: words:[{(a)} {(b)} {(c)}])} ) ] ) ] ) ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:array) op: Equal rhs: {(sh_array_literal left: words:[{(a)} {(b)} {(c)}])} ) ] ) ] ) ) ] )(command.CommandList children: [ (C { (command_sub left_token: command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(echo)} {(hi)})])] ) ] ) ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(ech.....o)} {(hi)})])] ) ] ) ) ] )(command.CommandList children: [ (C {(echo)} { (command_sub left_token: command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(echo)} {(comsub)})])] ) ] ) ) } ) ] )(command.CommandList children: [ (C {(echo)} { (command_sub left_token: command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(echo)} {(comsub1)})])] ) (command.Case to_match: {(bar)} arms: [(case_arm pat_list:[{(two)}] action:[(C {(echo)} {(comsub2)})])] ) ] ) ) } ) ] )(C {(echo)} { (DQ ('double ') (command_sub left_token: command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) ) (' quoted') ) } {(two)} )(command.CommandList children: [ (command.Sentence child:(C {(echo)} {(one)}) terminator:) (command.Sentence child: (C {(echo)} { (command_sub left_token: command_list: (command.CommandList children: [ (command.Case to_match: {(one)} arms: [ (case_arm pat_list: [ { (command_sub left_token: command_list: (command.CommandList children:[(C {(echo)} {(one)})]) ) } ] action: [ (C {(echo)} { (command_sub left_token: command_list: (command.CommandList children:[(C {(comsub)})]) ) } ) ] ) ] ) ] ) ) } ) terminator: ) (C {(echo)} {(two)}) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children:[(command.Case to_match:{(foo)})]) ) ] )(command.CommandList children: [ (C { (command_sub left_token: command_list: (command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) update: (arith_expr.UnaryAssign op_id:Arith_DPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children:[(C {(echo)} {(hi)})]) ) ] ) ) } ) ] )(command.CommandList children: [ (command.Subshell command_lis.....t: (command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) update: (arith_expr.UnaryAssign op_id:Arith_DPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children:[(C {(echo)} {(hi)})]) ) ] ) ) ] )(C {(echo)} { (word_part.ArithSub anode: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.IndexedName name: a index: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) ) ) right: (arith_expr.VarRef token:) ) ) } )(C {(echo)} { (command_sub left_token: command_list: (command.CommandList children: [ (C {(one) (command_sub left_token: command_list: (command.CommandList children:[(C {(echo)} {(two)})]) ) (one) } ) ] ) ) } {(three)} )(command.BraceGroup children: [ (command.Sentence child:(C {(cd)} {(/)}) terminator:) (command.Sentence child:(C {(echo)} {(PWD)}) terminator:) ] )(command.CommandList children: [ (command.Sentence child: (command.BraceGroup children: [ (command.Sentence child:(C {(cd)} {(/)}) terminator:) (command.Sentence child:(C {(echo)} {(PWD)}) terminator:) ] ) terminator: ) (C {(echo)} {(PWD)}) ] )(command.CommandList children: [ (command.Sentence child: (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child:(C {(cd)} {(/)}) terminator:) (C {(echo)} {(PWD)} {(1)}) ] ) ) terminator: ) (C {(echo)} {(PWD)} {(2)}) ] )(command.CommandList children: [ (C {(echo)} { (command_sub left_token: command_list: (command.CommandList children: [ (command.Sentence child: (command.ShFunction name: fun body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(hi)}) terminator: ) ] ) ) terminator: ) (C {(fun)}) ] ) ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child: (command.ShFunction name: fun body: ..... errcmd=( "${SETUP_STATE[$err.cmd]}" ) ^ '':1: Unexpected token in arithmetic context (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] ) ) terminator: ) (C {(fun)}) ] ) ) ] )(command.CommandList children: [ (command.Sentence child:(C {(echo)} {(one)}) terminator:) (command.Sentence child: (C {(echo)} { (command_sub left_token: command_list: (command.CommandList children: [ (command.Sentence child: (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child: (C {(cd)} {(/)}) terminator: ) (C {(echo)} {(subshell_PWD)}) ] ) ) terminator: ) (C {(echo)} {(comsub_PWD)}) ] ) ) } ) terminator: ) (C {(echo)} {(two)}) ] )(command.CommandList children: [ (C { (command_sub left_token: command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(echo)} {(hi)})])] ) ] ) ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(echo)} {(hi)})])] ) ] ) ) ] )(C {(echo)} {(ab) (command_sub left_token: command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) ) (cd) } {(ef)} )(command.CommandList children: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: BoolUnary_n child: { (DQ (braced_var_sub token: bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {(${ VSub_Name tag_marker) (Lit_Digits 002) (${ VSub_Name cons_ptr)} ) ) ) ) } ) ) terminator: ) ] )(command.CommandList children: [ (C {(echo)} { (word_part.ArithSub anode: (arith_expr.ArithWord w: {(Lit_Digits 0) (Lit_ArithVarLike x) ($ VSub_DollarName '$foo')} ) ) } ) ] )(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:errcmd) op: Equal rhs: { (sh_array_literal left: words: [ { (DQ (braced_var_sub token: bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ ($ VSub_DollarName '$err') (.cmd))}) ) .... ) ) } ] ) } ) ] ) ] )(command.CommandList children: [(C {(echo)} {(command_sub left_token: command_list:(command.NoOp))})] )(command.CommandList children: [(C {(echo)} {(command_sub left_token: command_list:(command.NoOp))})] )(command.CommandList children: [ (C {(cmd)} {(flag)} {(command_sub left_token: command_list:(command.NoOp))} {(flag2)} ) ] )(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:FOO) op: Equal rhs: {(DQ (bar)) (command_sub left_token: command_list:(command.NoOp)) (DQ (baz)) } ) ] ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(true)}) terminator:)] action: [ (command.Subshell command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) ) ] ) ] ) ] )(command.CommandList children: [ (command.WhileUntil keyword: cond: [(command.Sentence child:(C {(true)}) terminator:)] body: (command.DoGroup children: [ (command.BraceGroup children: [(C {(echo)} {(hi)}) (command.ControlFlow token:)] ) ] ) ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(true)}) terminator:)] action: [ (command.Subshell command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) ) ] ) ] ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(true)}) terminator:)] action: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(true)}) terminator:)] action: [(C {(echo)} {(hi)})] ) ] ) ] ) ] ) (C {(echo)} {(hi)}) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(cd)} {(DQ ($ VSub_DollarName '$PACKDIR'))}) (command.ForEach iter_name: e iter_words: [{($ VSub_DollarName '$existing')}] do_arg_iter: F body: (command.DoGroup children: [ (command.Case to_match: {(DQ (' ') ($ VSub_DollarName '$fullbases') (' '))} arms: [ (case_arm pat_list: [ {(Lit_Star '*') (DQ (' ') ($ VSub_DollarName '$e') (' ')) (Lit_Star '*') } ] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [ (C {(rm)} {(-f)} {(DQ ($ VSub_DollarName '$e') (.pack))} {(DQ ($ VSub_DollarName '$e') (.idx))} {(DQ ($ VSub_DollarName '$e') (.keep))} ) ] ) ] ) ] ) ) ] ) ................. ] ) ) ] )(command.CommandList children: [ (command.Sentence child: (C {(.)} {(DQ ($ VSub_DollarName '$TEST_DIRECTORY')) (/diff-lib.sh)}) terminator: ) ] )(command.CommandList children:[(C {(echo)} {(foo) (Lit_Pound '#') (bar)})])(command.CommandList children:[(C {(echo)} {(foo)})])(command.CommandList children:[(C {(echo)} {(foo)})])(command.Case to_match: {(DQ ($ VSub_DollarName '$fd') (',') ($ VSub_DollarName '$command'))} arms: [ (case_arm pat_list: [{(3) (Lit_Comma ',') (Lit_Pound '#') (Lit_Star '*')} {(3) (Lit_Comma ',')}] ) ] )(command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(single_quoted left: tokens:[])}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: PlusEqual rhs: {(DQ (word_part.EscapedLiteral token:)) (word_part.EscapedLiteral token:) } ) ] ) ] ) ] ) ] )(command.CommandList children: [ (C { (single_quoted left: tokens: [ ] ) } ) ] )(command.Simple words: [{(echo)} {(hi)}] redirects: [(redir.Redir op:|'> fd:16777215 arg_word:{(clobbered.txt)})] )(redir.Redir op:&'> fd:1 arg_word:{(2)})(redir.HereDoc op: fd:16777215 here_begin:{(EOF)} here_end_span_id:None)(redir.HereDoc op: fd:16777215 here_begin:{(EOF)} here_end_span_id:None)(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('hi\n')] ) (redir.Redir op:'> fd:16777215 arg_word:{(out.txt)}) ] )(redir.Redir op:'> fd:16777215 arg_word:{(out.txt)})(redir.HereDoc op: fd:16777215 here_begin:{(EOF)} here_end_span_id:None)(command.Simple words: [{(cat)}] redirects: [ (redir.Redir op:'> fd:16777215 arg_word:{(out.txt)}) (redir.Redir op:&'> fd:1 arg_word:{(2)}) ] )(command.Simple words: [{(cat)}] redirects: [(redir.Redir op: fd:16777215 arg_word:{(3)})] )(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs:(sh_lhs_expr.Name name:ONE) op:Equal rhs:{(1)}) (assign_pair lhs:(sh_lhs_expr.Name name:TWO) op:Equal rhs:{(2)}) ] ) ] )(command.CommandList children: [ (command.Simple redirects: [(redir.Redir op:'> fd:16777215 arg_word:{(out.txt)})] ) ] )(C {(echo)} {(DQ (one)) (two)} {(DQ (three)) (DQ (four))} {(five)})(command.CommandList children: [ (command.Simple words: [{(env)}] redirects: [(redir.Redir op:'> fd:16777215 arg_word:{(out.txt)})] more_env: [(env_pair name:PYTHONPATH val:{(.)})] ) ] )(command.CommandList children: [ (command.Simple words: [{(echo)} {(1)} {(2)} {(3)}] redirects: [(redir.Redir op:'> fd:16777215 arg_word:{(out.txt)})] ) ] )(C {(ls)} {(foo)})(command.Simple words:[{(ls)} {(foo)}] more_env:[(env_pair name:FOO val:{(bar)})])(command.Simple words: [{(ls)} {(foo)}] redirects: [(redir.Redir op:'> fd:16777215 arg_word:{(output.txt)})] more_env: [(env_pair name:FOO val:{(bar)}) (env_pair name:SPAM val:{(eggs)})] )(command.Simple words: [{(ls)} {(foo)}] redirects: [ (redir.Redir op:'> fd:16777215 arg_word:{(output.txt)}) (redir.Redir op:'> fd:16777215 arg_word:{(output2.txt)}) ] more_env: [(env_pair n. ---------------------------------------------------------------------- Ran 79 tests in 0.106s OK ame:FOO val:{(bar)}) (env_pair name:SPAM val:{(eggs)})] )