===== CASE: FOO=1 break ===== FOO=1 break ^~~~ [ -c flag ]:1: Control flow shouldn't have environment bindings ===== CASE: break 1 2 ===== break 1 2 ^ [ -c flag ]:1: Unexpected argument to 'break' ===== CASE: x"y"() { echo hi; } ===== x"y"() { echo hi; } ^ [ -c flag ]:1: Invalid function name ===== CASE: function x"y" { echo hi; } ===== function x"y" { echo hi; } ^ [ -c flag ]:1: Invalid KSH-style function name ===== CASE: } ===== } ^ [ -c flag ]:1: Unexpected right brace ===== CASE: case foo in *) echo ===== case foo in *) echo ^ [ -c flag ]:1: Expected ;; or esac ===== CASE: ls foo| ===== ls foo| ^ [ -c flag ]:1: Unexpected EOF while parsing command ===== CASE: ls foo&& ===== ls foo&& ^ [ -c flag ]:1: Unexpected EOF while parsing command ===== CASE: foo() ===== foo() ^ [ -c flag ]:1: Unexpected word while parsing compound command ===== CASE: break >out ===== (command.ControlFlow token: (Token id: Id.ControlFlow_Break col: 0 length: 5 span_id: 0 line: (SourceLine line_num:1 content:'break >out' src:(source.CFlag)) tval: break ) spids: [] ) skipping _oil-parse-error Skipping some cmd-parse cases on oils-for-unix ===== CASE: PYTHONPATH=. FOO=(1 2) python ===== PYTHONPATH=. FOO=(1 2) python ^~~~ [ -c flag ]:1: Environment bindings can't contain array literals ===== CASE: PYTHONPATH+=1 python ===== PYTHONPATH+=1 python ^~~~~~~~~~~~ [ -c flag ]:1: Expected = in environment binding, got += ===== CASE: echo line 2 echo $( echo ===== echo $( echo ^ [ -c flag ]:3: Invalid word while parsing command list ===== CASE: echo line 2 echo ` echo ===== echo ` echo ^ [ -c flag ]:3: Unexpected EOF while looking for closing backtick ===== CASE: echo line 2 echo ` echo \` ===== echo ` echo \` ^ [ -c flag ]:3: Unexpected EOF while looking for closing backtick ===== CASE: echo line 2 echo ` echo \`unclosed ` ===== echo ` echo \`unclosed ` ^ [ backticks in [ -c flag ] ]:3: Unexpected EOF while looking for closing backtick ===== CASE: echo `for x in` ===== echo `for x in` ^ [ backticks in [ -c flag ] ]:1: Invalid word in for loop ===== CASE: echo < << ===== echo < << ^~ [ -c flag ]:1: Invalid token after redirect operator ===== CASE: echo $( echo > >> ) ===== echo $( echo > >> ) ^~ [ -c flag ]:1: Invalid token after redirect operator ===== CASE: cat < 0 && 43 > 42)) ===== (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DAmp left: (arith_expr.Binary op_id: Id.Arith_Great left: (compound_word parts: [ (Token id: Id.Lit_Digits col: 2 length: 1 span_id: 1 line: (SourceLine line_num:1 content:'((1 > 0 && 43 > 42))' src:(source.CFlag)) tval: 1 ) ] ) right: (compound_word parts: [ (Token id: Id.Lit_Digits col: 6 length: 1 span_id: 5 line: (SourceLine line_num:1 content:'((1 > 0 && 43 > 42))' src:(source.CFlag)) tval: 0 ) ] ) ) right: (arith_expr.Binary op_id: Id.Arith_Great left: (compound_word parts: [ (Token id: Id.Lit_Digits col: 11 length: 2 span_id: 9 line: (SourceLine line_num:1 content:'((1 > 0 && 43 > 42))' src:(source.CFlag)) tval: 43 ) ] ) right: (compound_word parts: [ (Token id: Id.Lit_Digits col: 16 length: 2 span_id: 13 line: (SourceLine line_num:1 content:'((1 > 0 && 43 > 42))' src:(source.CFlag)) tval: 42 ) ] ) ) ) redirects: [] spids: [0 16] ) skipping _oil-parse-error ===== CASE: if ((1 > 0 && 43 > 42)); then echo yes; fi ===== (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DAmp left: (arith_expr.Binary op_id: Id.Arith_Great left: (compound_word parts: [ (Token id: Id.Lit_Digits col: 5 length: 1 span_id: 3 line: (SourceLine line_num: 1 content: 'if ((1 > 0 && 43 > 42)); then echo yes; fi' src: (source.CFlag) ) tval: 1 ) ] ) right: (compound_word parts: [ (Token id: Id.Lit_Digits col: 9 length: 1 span_id: 7 line: (SourceLine line_num: 1 content: 'if ((1 > 0 && 43 > 42)); then echo yes; fi' src: (source.CFlag) ) tval: 0 ) ] ) ) right: (arith_expr.Binary op_id: Id.Arith_Great left: (compound_word parts: [ (Token id: Id.Lit_Digits col: 14 length: 2 span_id: 11 line: (SourceLine line_num: 1 content: 'if ((1 > 0 && 43 > 42)); then echo yes; fi' src: (source.CFlag) ) tval: 43 ) ] ) right: (compound_word parts: [ (Token id: Id.Lit_Digits col: 19 length: 2 span_id: 15 line: (SourceLine line_num: 1 content: 'if ((1 > 0 && 43 > 42)); then echo yes; fi' src: (source.CFlag) ) tval: 42 ) ] ) ) ) redirects: [] spids: [2 18] ) terminator: (Token id: Id.Op_Semi col: 23 length: 1 span_id: 18 line: (SourceLine line_num:1 content:'if ((1 > 0 && 43 > 42)); then echo yes; fi' src:(source.CFlag)) tval: _ ) spids: [] ) ] ) action: [ (command.Sentence child: (command.Simple words: [ (compound_word parts: [ (Token id: Id.Lit_Chars col: 30 length: 4 span_id: 22 line: (SourceLine line_num: 1 content: 'if ((1 > 0 && 43 > 42)); then echo yes; fi' src: (source.CFlag) ) tval: echo ) ] ) (compound_word parts: [ (Token id: Id.Lit_Chars col: 35 length: 3 span_id: 24 line: (SourceLine line_num: 1 content: 'if ((1 > 0 && 43 > 42)); then echo yes; fi' src: (source.CFlag) ) tval: yes ) ] ) ] redirects: [] more_env: [] do_fork: T spids: [] ) terminator: (Token id: Id.Op_Semi col: 38 length: 1 span_id: 25 line: (SourceLine line_num:1 content:'if ((1 > 0 && 43 > 42)); then echo yes; fi' src:(source.CFlag)) tval: _ ) spids: [] ) ] spids: [0 20] ) ] else_action: [] redirects: [] spids: [-1 27] ) skipping _oil-parse-error ===== CASE: for ((x = 1; x < 5; ++x)); do echo $x; done ===== (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (simple_var_sub left: (Token id: Id.Lit_ArithVarLike col: 6 length: 1 span_id: 3 line: (SourceLine line_num:1 content:'for ((x = 1; x < 5; ++x)); do echo $x; done' src:(source.CFlag)) tval: x ) var_name: x ) right: (compound_word parts: [ (Token id: Id.Lit_Digits col: 10 length: 1 span_id: 7 line: (SourceLine line_num:1 content:'for ((x = 1; x < 5; ++x)); do echo $x; done' src:(source.CFlag)) tval: 1 ) ] ) ) cond: (arith_expr.Binary op_id: Id.Arith_Less left: (simple_var_sub left: (Token id: Id.Lit_ArithVarLike col: 13 length: 1 span_id: 10 line: (SourceLine line_num:1 content:'for ((x = 1; x < 5; ++x)); do echo $x; done' src:(source.CFlag)) tval: x ) var_name: x ) right: (compound_word parts: [ (Token id: Id.Lit_Digits col: 17 length: 1 span_id: 14 line: (SourceLine line_num:1 content:'for ((x = 1; x < 5; ++x)); do echo $x; done' src:(source.CFlag)) tval: 5 ) ] ) ) update: (arith_expr.UnaryAssign op_id: Id.Arith_DPlus child: (simple_var_sub left: (Token id: Id.Lit_ArithVarLike col: 22 length: 1 span_id: 18 line: (SourceLine line_num:1 content:'for ((x = 1; x < 5; ++x)); do echo $x; done' src:(source.CFlag)) tval: x ) var_name: x ) ) body: (command.DoGroup children: [ (command.Sentence child: (command.Simple words: [ (compound_word parts: [ (Token id: Id.Lit_Chars col: 30 length: 4 span_id: 25 line: (SourceLine line_num: 1 content: 'for ((x = 1; x < 5; ++x)); do echo $x; done' src: (source.CFlag) ) tval: echo ) ] ) (compound_word parts: [ (simple_var_sub left: (Token id: Id.VSub_DollarName col: 35 length: 2 span_id: 27 line: (SourceLine line_num: 1 content: 'for ((x = 1; x < 5; ++x)); do echo $x; done' src: (source.CFlag) ) tval: '$x' ) var_name: x ) ] ) ] redirects: [] more_env: [] do_fork: T spids: [] ) terminator: (Token id: Id.Op_Semi col: 37 length: 1 span_id: 28 line: (SourceLine line_num:1 content:'for ((x = 1; x < 5; ++x)); do echo $x; done' src:(source.CFlag)) tval: _ ) spids: [] ) ] spids: [23 30] ) redirects: [] spids: [] ) skipping _oil-parse-error Skipping parse_dparen cases skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping oil_nested_proc skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping oil_var_decl skipping _oil-parse-error skipping _oil-parse-error skipping oil_place_mutation ===== CASE: case $foo { (*.py) echo "python" ;; } ===== (command.Case to_match: (compound_word parts: [ (simple_var_sub left: (Token id: Id.VSub_DollarName col: 7 length: 4 span_id: 4 line: (SourceLine line_num:2 content:' case $foo {\n' src:(source.CFlag)) tval: '$foo' ) var_name: foo ) ] ) arms: [ (case_arm pat_list: [ (compound_word parts: [ (Token id: Id.Lit_Star col: 5 length: 1 span_id: 10 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: '*' ) (Token id: Id.Lit_Chars col: 6 length: 3 span_id: 11 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: .py ) ] ) ] action: [ (command.Simple words: [ (compound_word parts: [ (Token id: Id.Lit_Chars col: 11 length: 4 span_id: 14 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: echo ) ] ) (compound_word parts: [ (double_quoted left: (Token id: Id.Left_DoubleQuote col: 16 length: 1 span_id: 16 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: '"' ) parts: [ (Token id: Id.Lit_Chars col: 17 length: 6 span_id: 17 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: python ) ] right: (Token id: Id.Right_DoubleQuote col: 23 length: 1 span_id: 18 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: '"' ) ) ] ) ] redirects: [] more_env: [] do_fork: T spids: [] ) ] spids: [9 12 20 -1] ) ] redirects: [] spids: [2 6 23] ) ===== CASE: case "foo" { (*.py) echo "python" ;; } ===== (command.Case to_match: (compound_word parts: [ (double_quoted left: (Token id: Id.Left_DoubleQuote col: 7 length: 1 span_id: 4 line: (SourceLine line_num:2 content:' case "foo" {\n' src:(source.CFlag)) tval: '"' ) parts: [ (Token id: Id.Lit_Chars col: 8 length: 3 span_id: 5 line: (SourceLine line_num:2 content:' case "foo" {\n' src:(source.CFlag)) tval: foo ) ] right: (Token id: Id.Right_DoubleQuote col: 11 length: 1 span_id: 6 line: (SourceLine line_num:2 content:' case "foo" {\n' src:(source.CFlag)) tval: '"' ) ) ] ) arms: [ (case_arm pat_list: [ (compound_word parts: [ (Token id: Id.Lit_Star col: 5 length: 1 span_id: 12 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: '*' ) (Token id: Id.Lit_Chars col: 6 length: 3 span_id: 13 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: .py ) ] ) ] action: [ (command.Simple words: [ (compound_word parts: [ (Token id: Id.Lit_Chars col: 11 length: 4 span_id: 16 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: echo ) ] ) (compound_word parts: [ (double_quoted left: (Token id: Id.Left_DoubleQuote col: 16 length: 1 span_id: 18 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: '"' ) parts: [ (Token id: Id.Lit_Chars col: 17 length: 6 span_id: 19 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: python ) ] right: (Token id: Id.Right_DoubleQuote col: 23 length: 1 span_id: 20 line: (SourceLine line_num:3 content:' (*.py) echo "python" ;;\n' src:(source.CFlag)) tval: '"' ) ) ] ) ] redirects: [] more_env: [] do_fork: T spids: [] ) ] spids: [11 14 22 -1] ) ] redirects: [] spids: [2 8 25] ) skipping _oil-parse-error skipping _oil-parse-error skipping oil_for skipping oil_for skipping oil_issue_1118 ===== CASE: for x in & ===== for x in & ^ [ -c flag ]:1: Invalid word in for loop ===== CASE: for (( i=0; i<10; i++ )) ls ===== for (( i=0; i<10; i++ )) ls ^~ [ -c flag ]:1: Invalid word after for expression ===== CASE: for ( i=0; i<10; i++ ) ===== for ( i=0; i<10; i++ ) ^ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: for $x in 1 2 3; do echo $i; done ===== for $x in 1 2 3; do echo $i; done ^~ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: for x.y in 1 2 3; do echo $i; done ===== for x.y in 1 2 3; do echo $i; done ^~~ [ -c flag ]:1: Invalid loop variable name 'x.y' ===== CASE: for x in 1 2 3; & ===== for x in 1 2 3; & ^ [ -c flag ]:1: Expected word type Id.KW_Do, got Id.Op_Amp ===== CASE: for foo BAD ===== for foo BAD ^ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: for var in x; do echo $var; done ===== (command.ForEach iter_names: [var] iterable: (for_iter.Words words: [ (compound_word parts: [ (Token id: Id.Lit_Chars col: 11 length: 1 span_id: 6 line: (SourceLine line_num:1 content:'for var in x; do echo $var; done' src:(source.CFlag)) tval: x ) ] ) ] ) body: (command.DoGroup children: [ (command.Sentence child: (command.Simple words: [ (compound_word parts: [ (Token id: Id.Lit_Chars col: 17 length: 4 span_id: 11 line: (SourceLine line_num:1 content:'for var in x; do echo $var; done' src:(source.CFlag)) tval: echo ) ] ) (compound_word parts: [ (simple_var_sub left: (Token id: Id.VSub_DollarName col: 22 length: 4 span_id: 13 line: (SourceLine line_num:1 content:'for var in x; do echo $var; done' src:(source.CFlag)) tval: '$var' ) var_name: var ) ] ) ] redirects: [] more_env: [] do_fork: T spids: [] ) terminator: (Token id: Id.Op_Semi col: 26 length: 1 span_id: 14 line: (SourceLine line_num:1 content:'for var in x; do echo $var; done' src:(source.CFlag)) tval: _ ) spids: [] ) ] spids: [9 16] ) redirects: [] spids: [0 4 7] ) skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping invalid_parens on oils-for-unix skipping _runtime-parse-error ---------------------- ===== CASE: test/parse-errors/01-bad-func.sh ===== Skipping file test/parse-errors/01-bad-func.sh for oils-for-unix ===== CASE: test/parse-errors/02-bad-func.sh ===== foo() ^ 'test/parse-errors/02-bad-func.sh':3: Unexpected word while parsing compound command ===== CASE: test/parse-errors/05-unterminated-single.sh ===== A B echo 'C ^ 'test/parse-errors/05-unterminated-single.sh':5: Unexpected EOF in single-quoted string that began here ===== CASE: test/parse-errors/06-unterminated-double-long.sh ===== A B echo 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 " ^ 'test/parse-errors/06-unterminated-double-long.sh':9: Unexpected EOF reading double-quoted string that began here ===== CASE: test/parse-errors/06-unterminated-double.sh ===== A B echo "0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 ^ 'test/parse-errors/06-unterminated-double.sh':6: Unexpected EOF reading double-quoted string that began here ===== CASE: test/parse-errors/07-unterminated-here-doc-2.sh ===== cat << "$@" ^ 'test/parse-errors/07-unterminated-here-doc-2.sh':2: Invalid here doc delimiter ===== CASE: test/parse-errors/07-unterminated-here-doc.sh ===== cat <