ls array=(a b c) ^~~~~~ '':1: Commands can't contain array literals array=(a b c) ls ^~~~~~ '':1: Environment bindings can't contain array literals .....(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:empty) op:Equal rhs:{(word_part.ArrayLiteralPart)})] ) ] )(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:array) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} ) ] ) ] )(command.CommandList children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:array) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} ) ] ) terminator: ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:array2) op: Equal rhs: {(word_part.ArrayLiteralPart 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.SimpleCommand words: [ (word.CompoundWord parts: [(word_part.LiteralPart token:(token id:Lit_Chars val:ls span_id:0))] ) (word.CompoundWord parts: [(word_part.LiteralPart token:(token id:Lit_Chars val:foo span_id:2))] ) ] ) (command.FuncDef name: func body: (command.BraceGroup children: [ (command.Sentence child: (command.SimpleCommand words: [ (word.CompoundWord parts: [(word_part.LiteralPart token:(token id:Lit_Chars val:echo span_id:6))] ) (word.CompoundWord parts: [(word_part.LiteralPart token:(token id:Lit_Chars val:hi span_id:8))] ) ] ) terminator: (token id:Op_Semi val:';' span_id:9) ) ] spids: [4] ) spids: [0 3] ) (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(12)})]) left_token: ) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(34)})]) left_token: ) } )(C {(echo)} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(12)})]) left_token: ) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(34)})]) left_token: ) ) } )(command.CommandList children: [ (command.DBracket expr: (bool_expr.BoolBinary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}) ) ] )(command.CommandList children: [ (command.DB.....racket expr: (bool_expr.LogicalAnd left: (bool_expr.BoolBinary 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.BoolBinary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}) ) ] action: [(C {(echo)} {(hi)})] ) ] ) ] )(command.CommandList children: [ (command.DBracket expr: (bool_expr.BoolBinary op_id:BoolBinary_EqualTilde left:{(foo)} right:{(foo)}) ) ] )(command.CommandList children: [ (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_EqualTilde left: {(foo)} right: {(Lit_Other '(') (foo) (Lit_Other '|') (bar) (Lit_Other ')')} ) ) ] )(command.CommandList children: [ (command.DParen child: (arith_expr.ArithBinary 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: (lhs_expr.LhsName name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.ArithBinary op_id: Arith_Less left: (arith_expr.ArithVarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 5)}) ) update: (arith_expr.UnaryAssign op_id:Arith_DPlus child:(lhs_expr.LhsName 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: (lhs_expr.LhsName name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.ArithBinary op_id: Arith_Less left: (arith_expr.ArithVarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 5)}) ) update: (arith_expr.UnaryAssign op_id:Arith_DPlus child:(lhs_expr.LhsName 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.FuncDef name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] ) ) ] )(command.CommandList children: [ (command.FuncDef name: foo body: (command.Subshell command_list:(command.CommandList children:[(C {(echo)} {(hi)})])) ) ] )(command.CommandList children: [ (command.FuncDef name: foo body: (command.ForEach i... ls foo| ^ '':1: Unexpected EOF while parsing command ..ter_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.FuncDef name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] ) ) ] )(command.CommandList children: [ (command.FuncDef name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] ) ) ] )(command.CommandList children: [ (command.FuncDef name: foo body: (command.Subshell command_list:(command.CommandList children:[(C {(echo)} {(hi)})])) ) ] )(command.CommandList children: [ (command.FuncDef 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.FuncDef 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.FuncDef 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.TildeSubPart token:)} {(word_part.TildeSubPart token:)} {(word_part.TildeSubPart token:) (/src)} {(word_part.TildeSubPart token:) (/src/foo)} {(word_part.TildeSubPart token:..... (( 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 ls BAD_ENV=(1 2 3) ^~~~~~~~ '':1: Commands can't contain array literals ENV1=A ENV2=B local foo=bar ^~~~~ '':1: Assignments shouldn't have environment bindings 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: Loop variable name should be a constant 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 . x=1 >/dev/null ^~ '':1: Global assignment shouldn't have redirects echo hi; x=1 >/dev/null ^~ '':1: Global assignment shouldn't have redirects declare x=1 >/dev/null ^~~~~~~ '':1: Assignments shouldn't have redirects ..) (/src)} {(Lit_TildeLike '~weird') (KW_Bang '!') (name/blah) (KW_Bang '!') (blah)} ) ] )(command.CommandList children: [ (command.WhileUntil 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.SimpleCommand 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.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 17 stdin_parts: [ ('1 ') (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(2)}) (C {(echo)} {(3)})]) left_token: ) (' 4\n') ] ) ] )(command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand 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.SimpleCommand 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.SimpleCommand 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.SimpleCommand 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.SimpleCommand 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.SimpleCommand 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.SimpleCommand 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.SimpleCommand 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.SimpleCommand 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.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(DQ (EOF))} here_end_span_id: 9 stdin_parts: [('$v\n') ('"two\n')] ) ] )(command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(SQ )} here_end_span_id: 8 stdin_parts: [('single-quoted: $var\n')] ) ] )(command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EO) (word_part.EscapedLiteralPart token:)} here_end_span_id: 8 stdin_parts: [('single-quoted: $var\n')] ) ] )(command.CommandList children: [ (command.Pipeline children: [ (command.SimpleCommand 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.SimpleCommand 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.SimpleCommand 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)} { (word_part.CommandSubPa...rt command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Star left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) ) ) } ) ] ) left_token: ) } )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Star left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) ) ) } ) ] ) ) ] )(C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithWord w:{(Lit_Digits 2)}) ) ) } ) ] ) left_token: ) } )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.ArithBinary 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)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:array) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} ) ] ) ] ) left_token: ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:array) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} ) ] ) ] ) ) ] )(command.CommandList children: [ (C { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Case to_match: {(f.....oo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(echo)} {(hi)})])] ) ] ) left_token: ) } ) ] )(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)})])] ) ] ) ) ] )(command.CommandList children: [ (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(echo)} {(comsub)})])] ) ] ) left_token: ) } ) ] )(command.CommandList children: [ (C {(echo)} { (word_part.CommandSubPart 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)})])] ) ] ) left_token: ) } ) ] )(C {(echo)} { (DQ ('double ') (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) left_token: ) (' quoted') ) } {(two)} )(command.CommandList children: [ (command.Sentence child:(C {(echo)} {(one)}) terminator:) (command.Sentence child: (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Case to_match: {(one)} arms: [ (case_arm pat_list: [ { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(one)})]) left_token: ) } ] action: [ (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(comsub)})]) left_token: ) } ) ] ) ] ) ] ) left_token: ) } ) terminator: ) (C {(echo)} {(two)}) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children:[(command.Case to_match:{(foo)})]) ) ] )(command.CommandList children: [ (C { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (lhs_expr.LhsName name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.ArithBinary op...._id: Arith_Less left: (arith_expr.ArithVarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) update: (arith_expr.UnaryAssign op_id:Arith_DPlus child:(lhs_expr.LhsName name:i)) body: (command.DoGroup children:[(C {(echo)} {(hi)})]) ) ] ) left_token: ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (lhs_expr.LhsName name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.ArithBinary op_id: Arith_Less left: (arith_expr.ArithVarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) update: (arith_expr.UnaryAssign op_id:Arith_DPlus child:(lhs_expr.LhsName name:i)) body: (command.DoGroup children:[(C {(echo)} {(hi)})]) ) ] ) ) ] )(command.CommandList children: [ (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Sentence child: (command.FuncDef name: func body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(hi)}) terminator: ) ] ) ) terminator: ) (C {(func)}) ] ) left_token: ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child: (command.FuncDef name: func body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] ) ) terminator: ) (C {(func)}) ] ) ) ] )(C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.BinaryAssign op_id: Arith_Equal left: (lhs_expr.LhsIndexedName name: a index: (arith_expr.ArithBinary op_id: Arith_Star left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) ) ) right: (arith_expr.ArithVarRef token:) ) ) } )(C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(one) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(two)})]) left_token: ) (one) } ) ] ) left_token: ) } {(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: [ (command.Sentence child:(C {(echo)} {(one)}) terminator:) (command.Sentence child: (C {(echo)} { (word_part.CommandSubPart 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)}) ] ) left_token: ) } ) terminator: ) (C {(echo)} {(two)}) ] )(command.CommandList children: [ (C { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(echo)} {(hi)})])] ) ] ) left_token: ) } ) ] )(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) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) left_token: ) (cd) } {(ef)} )(command.CommandList children: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolUnary op_id: BoolUnary_n child: { (DQ (word_part.BracedVarSub 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.ArithSubPart anode: (arith_expr.ArithWord w: {(Lit_Digits 0) (Lit_ArithVarLike x) ($ VSub_DollarName '$foo')} ) . errcmd=( "${SETUP_STATE[$err.cmd]}" ) ^ '':1: Unexpected token in arithmetic context .... ) } ) ] )(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:errcmd) op: Equal rhs: { (word_part.ArrayLiteralPart words: [ { (DQ (word_part.BracedVarSub token: bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ ($ VSub_DollarName '$err') (.cmd))}) ) ) ) } ] ) } ) ] ) ] )(command.CommandList children: [ (C {(echo)} {(word_part.CommandSubPart command_list:(command.NoOp) left_token:)} ) ] )(command.CommandList children: [ (C {(echo)} {(word_part.CommandSubPart command_list:(command.NoOp) left_token:)}) ] )(command.CommandList children: [ (C {(cmd)} {(flag)} {(word_part.CommandSubPart command_list:(command.NoOp) left_token:)} {(flag2)} ) ] )(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:FOO) op: Equal rhs: {(DQ (bar)) (word_part.CommandSubPart command_list: (command.NoOp) left_token: ) (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_li..............st: [ {(Lit_Other '*') (DQ (' ') ($ VSub_DollarName '$e') (' ')) (Lit_Other '*') } ] ) (case_arm pat_list: [{(Lit_Other '*')}] 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_Other '*')} {(3) (Lit_Comma ',')}] ) ] )(command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [ { (word_part.SingleQuotedPart left: tokens: [] ) } ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ret) op: PlusEqual rhs: {(DQ (word_part.EscapedLiteralPart token:)) (word_part.EscapedLiteralPart token: ) } ) ] ) ] ) ] ) ] )(command.CommandList children: [ (C { (word_part.SingleQuotedPart left: tokens: [ ] ) } ) ] )(command.SimpleCommand 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.SimpleCommand 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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:'> fd:16777215 arg_word:{(out.txt)}) (redir.Redir op:&'> fd:1 arg_word:{(2)}) ] )(command.SimpleCommand words: [{(cat)}] redirects: [(redir.Redir op: fd:16777215 arg_word:{(3)})] )(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs:(lhs_expr.LhsName name:ONE) op:Equal rhs:{(1)}) (assign_pair lhs:(lhs_expr.LhsName name:TWO) op:Equal rhs:{(2)}) ] ) ] )(command.CommandList children: [ (command.SimpleCommand redirect.. FOO=bar local foo=$(env) ^~~~ '':1: Assignments shouldn't have environment bindings ..... ---------------------------------------------------------------------- Ran 83 tests in 0.078s OK s: [(redir.Redir op:'> fd:16777215 arg_word:{(out.txt)})] ) ] )(C {(echo)} {(DQ (one)) (two)} {(DQ (three)) (DQ (four))} {(five)})(command.CommandList children: [ (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs:(lhs_expr.LhsName name:foo) op:Equal rhs:{(bar)}) (assign_pair lhs:(lhs_expr.LhsName name:spam) op:Equal) (assign_pair lhs:(lhs_expr.LhsName name:eggs) op:Equal) (assign_pair lhs:(lhs_expr.LhsName name:one) op:Equal rhs:{(1)}) ] ) ] )(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:foo) op:Equal rhs:{(bar)})] ) ] )(command.CommandList children: [ (command.SimpleCommand words: [{(env)}] redirects: [(redir.Redir op:'> fd:16777215 arg_word:{(out.txt)})] more_env: [(env_pair name:PYTHONPATH val:{(.)})] ) ] )(command.CommandList children: [ (command.SimpleCommand words: [{(echo)} {(1)} {(2)} {(3)}] redirects: [(redir.Redir op:'> fd:16777215 arg_word:{(out.txt)})] ) ] )(C {(ls)} {(foo)})(command.SimpleCommand words:[{(ls)} {(foo)}] more_env:[(env_pair name:FOO val:{(bar)})])(command.SimpleCommand 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.SimpleCommand 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 name:FOO val:{(bar)}) (env_pair name:SPAM val:{(eggs)})] )(command.CommandList children: [ (command.Assignment keyword: Assign_Readonly pairs: [ (assign_pair lhs:(lhs_expr.LhsName name:ONE) op:Equal rhs:{(1)}) (assign_pair lhs:(lhs_expr.LhsName name:TWO) op:Equal rhs:{(2)}) (assign_pair lhs:(lhs_expr.LhsName name:THREE) op:Equal) ] ) ] )