[1/21] cxx asan '' cpp/fanos.cc _build/obj/cxx-asan/cpp/fanos.o [2/21] cxx asan '' cpp/libc.cc _build/obj/cxx-asan/cpp/libc.o [3/21] cxx asan '' cpp/frontend_pyreadline.cc _build/obj/cxx-asan/cpp/frontend_pyreadline.o [4/21] cxx asan '' cpp/frontend_flag_spec.cc _build/obj/cxx-asan/cpp/frontend_flag_spec.o [5/21] cxx asan '' cpp/osh_tdop.cc _build/obj/cxx-asan/cpp/osh_tdop.o [6/21] cxx asan '' cpp/core.cc _build/obj/cxx-asan/cpp/core.o [7/21] cxx asan '' cpp/osh.cc _build/obj/cxx-asan/cpp/osh.o [8/21] cxx asan '' cpp/pylib.cc _build/obj/cxx-asan/cpp/pylib.o [9/21] cxx asan '' _gen/frontend/arg_types.cc _build/obj/cxx-asan/_gen/frontend/arg_types.o [10/21] cxx asan '' cpp/frontend_match.cc _build/obj/cxx-asan/cpp/frontend_match.o [11/21] cxx asan '' cpp/pgen2.cc _build/obj/cxx-asan/cpp/pgen2.o [12/21] cxx asan '' _gen/data_lang/nil8.asdl.cc _build/obj/cxx-asan/_gen/data_lang/nil8.asdl.o [13/21] cxx asan '' cpp/stdlib.cc _build/obj/cxx-asan/cpp/stdlib.o [14/21] cxx asan '' _gen/frontend/signal.cc _build/obj/cxx-asan/_gen/frontend/signal.o [15/21] cxx asan '' _gen/frontend/consts.cc _build/obj/cxx-asan/_gen/frontend/consts.o [16/21] cxx asan '' _gen/osh/arith_parse.cc _build/obj/cxx-asan/_gen/osh/arith_parse.o [17/21] cxx asan '' _gen/frontend/help_meta.cc _build/obj/cxx-asan/_gen/frontend/help_meta.o [18/21] cxx asan '' _gen/ysh/grammar_tables.cc _build/obj/cxx-asan/_gen/ysh/grammar_tables.o [19/21] cxx asan '' _gen/bin/oils_for_unix.mycpp.cc _build/obj/cxx-asan/_gen/bin/oils_for_unix.mycpp.o [20/21] LINK cxx asan '' _bin/cxx-asan/oils-for-unix _build/obj/cxx-asan/_gen/bin/oils_for_unix.mycpp.o _build/obj/cxx-asan/_gen/bin/text_files.o _build/obj/cxx-asan/_gen/core/runtime.asdl.o _build/obj/cxx-asan/_gen/core/value.asdl.o _build/obj/cxx-asan/_gen/cpp/build_stamp.o _build/obj/cxx-asan/cpp/core.o _build/obj/cxx-asan/cpp/data_lang.o _build/obj/cxx-asan/cpp/fanos.o _build/obj/cxx-asan/cpp/fanos_shared.o _build/obj/cxx-asan/cpp/frontend_flag_spec.o _build/obj/cxx-asan/cpp/frontend_match.o _build/obj/cxx-asan/cpp/frontend_pyreadline.o _build/obj/cxx-asan/cpp/libc.o _build/obj/cxx-asan/cpp/osh.o _build/obj/cxx-asan/cpp/osh_tdop.o _build/obj/cxx-asan/cpp/pgen2.o _build/obj/cxx-asan/cpp/pylib.o _build/obj/cxx-asan/cpp/stdlib.o _build/obj/cxx-asan/_gen/data_lang/nil8.asdl.o _build/obj/cxx-asan/_gen/display/pretty.asdl.o _build/obj/cxx-asan/_gen/frontend/arg_types.o _build/obj/cxx-asan/_gen/frontend/consts.o _build/obj/cxx-asan/_gen/frontend/help_meta.o _build/obj/cxx-asan/_gen/frontend/id_kind.asdl.o _build/obj/cxx-asan/_gen/frontend/signal.o _build/obj/cxx-asan/_gen/frontend/syntax.asdl.o _build/obj/cxx-asan/mycpp/bump_leak_heap.o _build/obj/cxx-asan/mycpp/gc_builtins.o _build/obj/cxx-asan/mycpp/gc_mops.o _build/obj/cxx-asan/mycpp/gc_mylib.o _build/obj/cxx-asan/mycpp/gc_str.o _build/obj/cxx-asan/mycpp/hash.o _build/obj/cxx-asan/mycpp/mark_sweep_heap.o _build/obj/cxx-asan/_gen/osh/arith_parse.o _build/obj/cxx-asan/_gen/ysh/grammar_tables.o [21/21] SYMLINK _bin/cxx-asan oils-for-unix osh 'osh' -> 'oils-for-unix' /// /// Cases in Files /// ===== CASE: FILE test/parse-errors/01-bad-func.sh ===== foo (,) ^ test/parse-errors/01-bad-func.sh:15: Syntax error in expression (near Id.Arith_Comma) ===== CASE: FILE test/parse-errors/02-bad-func.sh ===== foo() ^ test/parse-errors/02-bad-func.sh:3: Unexpected word while parsing compound command (Id.Eof_Real) ===== CASE: FILE 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: FILE 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: FILE 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: FILE 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: FILE test/parse-errors/07-unterminated-here-doc.sh ===== cat <out ===== (command.ControlFlow keyword: (Token id: Id.ControlFlow_Break length: 5 col: 0 line: (SourceLine line_num:1 content:"break >out" src:(source.CFlag)) ) ) ===== CASE: -n -c break >out ===== break >out ^~~~~ [ -c flag ]:1: Control flow shouldn't have redirects ===== CASE: -n -c [ ( x ] ===== [ ( x ] ^ [ -c flag ]:1: Syntax error in expression (near Id.Op_RBracket) OK test-cmd-parse *** Running test-command-sub ===== CASE: -n -c echo line 2 echo $( echo ===== echo $( echo ^ [ -c flag ]:3: Invalid word while parsing command list ===== CASE: -n -c echo line 2 echo ` echo ===== echo ` echo ^ [ -c flag ]:3: Unexpected EOF while looking for closing backtick ===== CASE: -n -c echo line 2 echo ` echo \` ===== echo ` echo \` ^ [ -c flag ]:3: Unexpected EOF while looking for closing backtick ===== CASE: -n -c echo line 2 echo ` echo \`unclosed ` ===== echo ` echo \`unclosed ` ^ [ backticks in [ -c flag ] ]:3: Unexpected EOF while looking for closing backtick ===== CASE: -n -c echo `for x in` ===== echo `for x in` ^ [ backticks in [ -c flag ] ]:1: Invalid word in for loop OK test-command-sub *** Running test-dparen ===== CASE: -n -c (()) ===== (command.DParen left: (Token id:Id.Op_DLeftParen length:2 col:0 line:(SourceLine line_num:1 content:"(())" src:(source.CFlag))) child: ...0x3ffffffc right: (Token id:Id.Op_DRightParen length:1 col:3 line:...0x13f6) ) ===== CASE: -n -c (( )) ===== (command.DParen left: (Token id:Id.Op_DLeftParen length:2 col:0 line:(SourceLine line_num:1 content:"(( ))" src:(source.CFlag))) child: ...0x3ffffffc right: (Token id:Id.Op_DRightParen length:1 col:4 line:...0x13f6) ) ===== CASE: -n -c (( ) ===== (( ) ^ [ -c flag ]:1: Expected second ) to end arith statement ===== CASE: -n -c (( )x ===== (( )x ^ [ -c flag ]:1: Expected second ) to end arith statement ===== CASE: -n -c $(echo $(( 1 + 2 ))) ===== (command.Simple blame_tok: (Token id: Id.Left_DollarParen length: 2 col: 0 line: (SourceLine line_num:1 content:"$(echo $(( 1 + 2 )))" src:(source.CFlag)) ) more_env: [] words: [ (CompoundWord parts: [ (CommandSub left_token: ...0x13ea child: (command.Simple blame_tok: (Token id:Id.Lit_Chars length:4 col:2 line:...0x13f2) more_env: [] words: [ (CompoundWord parts:[...0x13de]) (CompoundWord parts: [ (word_part.ArithSub left: (Token id:Id.Left_DollarDParen length:3 col:7 line:...0x13f2) anode: (arith_expr.Binary op: (Token id:Id.Arith_Plus length:1 col:13 line:...0x13f2) left: (CompoundWord parts: [(Token id:Id.Lit_Digits length:1 col:11 line:...0x13f2)] ) right: (CompoundWord parts: [(Token id:Id.Lit_Digits length:1 col:15 line:...0x13f2)] ) ) right: (Token id:Id.Right_DollarDParen length:1 col:18 line:...0x13f2) ) ] ) ] do_fork: T ) right: (Token id:Id.Eof_RParen length:1 col:19 line:...0x13f2) ) ] ) ] do_fork: T ) ===== CASE: -n -c $( (())) ===== (command.Simple blame_tok: (Token id:Id.Left_DollarParen length:2 col:0 line:(SourceLine line_num:1 content:"$( (()))" src:(source.CFlag))) more_env: [] words: [ (CompoundWord parts: [ (CommandSub left_token: ...0x13ea child: (command.DParen left: (Token id:Id.Op_DLeftParen length:2 col:3 line:...0x13f2) child: ...0x3ffffffc right: (Token id:Id.Op_DRightParen length:1 col:6 line:...0x13f2) ) right: (Token id:Id.Eof_RParen length:1 col:7 line:...0x13f2) ) ] ) ] do_fork: T ) ===== CASE: -n -c (( 1 + 2 / ===== (( 1 + 2 / ^ [ -c flag ]:1: Unexpected end of input ===== CASE: -n -c (( 1 + 2 )/ ===== (( 1 + 2 )/ ^ [ -c flag ]:1: Expected second ) to end arith statement ===== CASE: -n -c (( 1 ===== (( 1 ^ [ -c flag ]:1: Unexpected token after arithmetic expression (Id.Eof_Real != Id.Arith_RParen) ===== CASE: -n -c (( ===== (( ^ [ -c flag ]:1: Unexpected end of input OK test-dparen *** Running test-eval_parse_error ===== CASE: -c x="echo )" eval $x ===== echo ) ^ [ eval word at line 3 of [ -c flag ] ]:1 eval $x ^~~~ [ -c flag ]:3: Invalid word while parsing command line (Id.Op_RParen) OK test-eval_parse_error *** Running test-extra-newlines ===== CASE: -n -c for do done ===== for ^ [ -c flag ]:2: Expected loop variable (a constant word) ===== CASE: -n -c case in esac ===== case ^ [ -c flag ]:2: Expected a word to match against ===== CASE: -n -c while do done ===== do ^~ [ -c flag ]:3: Expected a condition ===== CASE: -n -c if then fi ===== then ^~~~ [ -c flag ]:3: Expected a condition ===== CASE: -n -c if true then elif then fi ===== then ^~~~ [ -c flag ]:5: Expected a condition ===== CASE: -n -c case | in esac ===== case | ^ [ -c flag ]:2: Expected a word to match against ===== CASE: -n -c case ; in esac ===== case ; ^ [ -c flag ]:2: Expected a word to match against ===== CASE: -n -c if true then fi ===== (command.If if_kw: (Token id:Id.KW_If length:2 col:2 line:(SourceLine line_num:2 content:" if\n" src:(source.CFlag))) arms: [ (IfArm keyword: ...0x13e2 cond: (condition.Shell commands: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:3 content:" true\n" src:...0x3ffffffc) ) more_env: [] words: [(CompoundWord parts:[...0x13c2])] do_fork: T ) ] ) then_kw: (Token id: Id.KW_Then length: 4 col: 2 line: (SourceLine line_num:4 content:" then\n" src:...0x3ffffffc) ) action: [] then_tok: ...0x1392 ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi length: 2 col: 2 line: (SourceLine line_num:5 content:" fi\n" src:...0x3ffffffc) ) ) ===== CASE: -n -c while false do done ===== (command.WhileUntil keyword: (Token id:Id.KW_While length:5 col:2 line:(SourceLine line_num:2 content:" while\n" src:(source.CFlag))) cond: (condition.Shell commands: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 5 col: 2 line: (SourceLine line_num:3 content:" false\n" src:...0x3ffffffc) ) more_env: [] words: [(CompoundWord parts:[...0x13be])] do_fork: T ) ] ) body: (command.DoGroup left: (Token id: Id.KW_Do length: 2 col: 2 line: (SourceLine line_num:4 content:" do\n" src:...0x3ffffffc) ) children: [] right: (Token id: Id.KW_Done length: 4 col: 2 line: (SourceLine line_num:5 content:" done\n" src:...0x3ffffffc) ) ) ) ===== CASE: -n -c while true; false do done ===== (command.WhileUntil keyword: (Token id:Id.KW_While length:5 col:2 line:(SourceLine line_num:2 content:" while\n" src:(source.CFlag))) cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:3 content:" true;\n" src:...0x3ffffffc) ) more_env: [] words: [(CompoundWord parts:[...0x13c2])] do_fork: T ) terminator: (Token id:Id.Op_Semi length:1 col:6 line:...0x13ca) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 5 col: 2 line: (SourceLine line_num:4 content:" false\n" src:...0x3ffffffc) ) more_env: [] words: [(CompoundWord parts:[...0x138a])] do_fork: T ) ] ) body: (command.DoGroup left: (Token id: Id.KW_Do length: 2 col: 2 line: (SourceLine line_num:5 content:" do\n" src:...0x3ffffffc) ) children: [] right: (Token id: Id.KW_Done length: 4 col: 2 line: (SourceLine line_num:6 content:" done\n" src:...0x3ffffffc) ) ) ) ===== CASE: -n -c if true then fi ===== (command.If if_kw: (Token id:Id.KW_If length:2 col:2 line:(SourceLine line_num:2 content:" if true\n" src:(source.CFlag))) arms: [ (IfArm keyword: ...0x13da cond: (condition.Shell commands: [ (command.Simple blame_tok: (Token id:Id.Lit_Chars length:4 col:5 line:...0x13e2) more_env: [] words: [(CompoundWord parts:[...0x13c6])] do_fork: T ) ] ) then_kw: (Token id: Id.KW_Then length: 4 col: 2 line: (SourceLine line_num:3 content:" then\n" src:...0x3ffffffc) ) action: [] then_tok: ...0x1392 ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi length: 2 col: 2 line: (SourceLine line_num:4 content:" fi\n" src:...0x3ffffffc) ) ) ===== CASE: -n -c while true; false do done ===== (command.WhileUntil keyword: (Token id:Id.KW_While length:5 col:2 line:(SourceLine line_num:2 content:" while true;\n" src:(source.CFlag))) cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id:Id.Lit_Chars length:4 col:8 line:...0x13ea) more_env: [] words: [(CompoundWord parts:[...0x13d2])] do_fork: T ) terminator: (Token id:Id.Op_Semi length:1 col:12 line:...0x13ea) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 5 col: 8 line: (SourceLine line_num:3 content:" false\n" src:...0x3ffffffc) ) more_env: [] words: [(CompoundWord parts:[...0x1396])] do_fork: T ) ] ) body: (command.DoGroup left: (Token id: Id.KW_Do length: 2 col: 2 line: (SourceLine line_num:4 content:" do\n" src:...0x3ffffffc) ) children: [] right: (Token id: Id.KW_Done length: 4 col: 2 line: (SourceLine line_num:5 content:" done\n" src:...0x3ffffffc) ) ) ) OK test-extra-newlines *** Running test-here-doc ===== CASE: -n -c cat < >> ) ===== echo $( echo > >> ) ^~ [ -c flag ]:1: Invalid token after redirect operator OK test-redirect *** Running test-regex-nix ===== CASE: -n -c if [[ ! (" ${params[*]} " =~ " -shared " || " ${params[*]} " =~ " -static " ) ]]; then echo hi fi ===== (command.If if_kw: (Token id: Id.KW_If length: 2 col: 0 line: (SourceLine line_num: 2 content: "if [[ ! (\" ${params[*]} \" =~ \" -shared \" || \" ${params[*]} \" =~ \" -static \" ) ]]; then\n" src: (source.CFlag) ) ) arms: [ (IfArm keyword: ...0x13ea cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: (Token id:Id.KW_DLeftBracket length:2 col:3 line:...0x13ee) expr: (bool_expr.LogicalNot child: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote length: 1 col: 9 line: ...0x13ee ) parts: [ (Token id: Id.Lit_Chars length: 1 col: 10 line: ...0x13ee ) (BracedVarSub left: (Token id: Id.Left_DollarBrace length: 2 col: 11 line: ...0x13ee ) token: (Token id: Id.VSub_Name length: 6 col: 13 line: ...0x13ee ) var_name: params bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) right: (Token id: Id.Right_DollarBrace length: 1 col: 22 line: ...0x13ee ) ) (Token id: Id.Lit_Chars length: 1 col: 23 line: ...0x13ee ) ] right: (Token id: Id.Right_DoubleQuote length: 1 col: 24 line: ...0x13ee ) ) ] ) right: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote length: 1 col: 29 line: ...0x13ee ) parts: [(Token id:Id.Lit_Chars length:9 col:30 line:...0x13ee)] right: (Token id: Id.Right_DoubleQuote length: 1 col: 39 line: ...0x13ee ) ) ] ) ) right: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote length: 1 col: 44 line: ...0x13ee ) parts: [ (Token id: Id.Lit_Chars length: 1 col: 45 line: ...0x13ee ) (BracedVarSub left: (Token id: Id.Left_DollarBrace length: 2 col: 46 line: ...0x13ee ) token: (Token id: Id.VSub_Name length: 6 col: 48 line: ...0x13ee ) var_name: params bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) right: (Token id: Id.Right_DollarBrace length: 1 col: 57 line: ...0x13ee ) ) (Token id: Id.Lit_Chars length: 1 col: 58 line: ...0x13ee ) ] right: (Token id: Id.Right_DoubleQuote length: 1 col: 59 line: ...0x13ee ) ) ] ) right: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote length: 1 col: 64 line: ...0x13ee ) parts: [(Token id:Id.Lit_Chars length:9 col:65 line:...0x13ee)] right: (Token id: Id.Right_DoubleQuote length: 1 col: 74 line: ...0x13ee ) ) ] ) ) ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:78 line:...0x13ee) ) terminator: (Token id:Id.Op_Semi length:1 col:80 line:...0x13ee) ) ] ) then_kw: (Token id:Id.KW_Then length:4 col:82 line:...0x13ee) action: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:3 content:" echo hi\n" src:...0x3ffffffc) ) more_env: [] words: [ (CompoundWord parts:[...0x129e]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:2 col:7 line:...0x12a6)]) ] do_fork: T ) ] then_tok: ...0x12be ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi length: 2 col: 0 line: (SourceLine line_num:4 content:"fi\n" src:...0x3ffffffc) ) ) ===== CASE: -n -c if [[ (foo =~ (x) ) ]]; then echo hi fi ===== (command.If if_kw: (Token id: Id.KW_If length: 2 col: 0 line: (SourceLine line_num:2 content:"if [[ (foo =~ (x) ) ]]; then\n" src:(source.CFlag)) ) arms: [ (IfArm keyword: ...0x13e6 cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: (Token id:Id.KW_DLeftBracket length:2 col:3 line:...0x13ea) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts: [(Token id:Id.Lit_Chars length:3 col:7 line:...0x13ea)] ) right: (CompoundWord parts: [ (word_part.BashRegexGroup left: (Token id:Id.BashRegex_LParen length:1 col:14 line:...0x13ea) child: (CompoundWord parts: [(Token id:Id.Lit_Chars length:1 col:15 line:...0x13ea)] ) right: (Token id: Id.Right_BashRegexGroup length: 1 col: 16 line: ...0x13ea ) ) ] ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:20 line:...0x13ea) ) terminator: (Token id:Id.Op_Semi length:1 col:22 line:...0x13ea) ) ] ) then_kw: (Token id:Id.KW_Then length:4 col:24 line:...0x13ea) action: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:3 content:" echo hi\n" src:...0x3ffffffc) ) more_env: [] words: [ (CompoundWord parts:[...0x1336]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:2 col:7 line:...0x133e)]) ] do_fork: T ) ] then_tok: ...0x1356 ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi length: 2 col: 0 line: (SourceLine line_num:4 content:"fi\n" src:...0x3ffffffc) ) ) ===== CASE: -n -c if [[ (foo =~ x) ]]; then echo hi fi ===== (command.If if_kw: (Token id: Id.KW_If length: 2 col: 0 line: (SourceLine line_num:2 content:"if [[ (foo =~ x) ]]; then\n" src:(source.CFlag)) ) arms: [ (IfArm keyword: ...0x13e6 cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: (Token id:Id.KW_DLeftBracket length:2 col:3 line:...0x13ea) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts: [(Token id:Id.Lit_Chars length:3 col:7 line:...0x13ea)] ) right: (CompoundWord parts: [(Token id:Id.Lit_Chars length:1 col:14 line:...0x13ea)] ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:17 line:...0x13ea) ) terminator: (Token id:Id.Op_Semi length:1 col:19 line:...0x13ea) ) ] ) then_kw: (Token id:Id.KW_Then length:4 col:21 line:...0x13ea) action: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:3 content:" echo hi\n" src:...0x3ffffffc) ) more_env: [] words: [ (CompoundWord parts:[...0x134e]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:2 col:7 line:...0x1356)]) ] do_fork: T ) ] then_tok: ...0x136e ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi length: 2 col: 0 line: (SourceLine line_num:4 content:"fi\n" src:...0x3ffffffc) ) ) ===== CASE: -n -c if [[ ! (" ${params[*]} " =~ " -shared " || " ${params[*]} " =~ " -static ") ]]; then echo hi fi ===== (command.If if_kw: (Token id: Id.KW_If length: 2 col: 0 line: (SourceLine line_num: 2 content: "if [[ ! (\" ${params[*]} \" =~ \" -shared \" || \" ${params[*]} \" =~ \" -static \") ]]; then\n" src: (source.CFlag) ) ) arms: [ (IfArm keyword: ...0x13ea cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: (Token id:Id.KW_DLeftBracket length:2 col:3 line:...0x13ee) expr: (bool_expr.LogicalNot child: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote length: 1 col: 9 line: ...0x13ee ) parts: [ (Token id: Id.Lit_Chars length: 1 col: 10 line: ...0x13ee ) (BracedVarSub left: (Token id: Id.Left_DollarBrace length: 2 col: 11 line: ...0x13ee ) token: (Token id: Id.VSub_Name length: 6 col: 13 line: ...0x13ee ) var_name: params bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) right: (Token id: Id.Right_DollarBrace length: 1 col: 22 line: ...0x13ee ) ) (Token id: Id.Lit_Chars length: 1 col: 23 line: ...0x13ee ) ] right: (Token id: Id.Right_DoubleQuote length: 1 col: 24 line: ...0x13ee ) ) ] ) right: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote length: 1 col: 29 line: ...0x13ee ) parts: [(Token id:Id.Lit_Chars length:9 col:30 line:...0x13ee)] right: (Token id: Id.Right_DoubleQuote length: 1 col: 39 line: ...0x13ee ) ) ] ) ) right: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote length: 1 col: 44 line: ...0x13ee ) parts: [ (Token id: Id.Lit_Chars length: 1 col: 45 line: ...0x13ee ) (BracedVarSub left: (Token id: Id.Left_DollarBrace length: 2 col: 46 line: ...0x13ee ) token: (Token id: Id.VSub_Name length: 6 col: 48 line: ...0x13ee ) var_name: params bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) right: (Token id: Id.Right_DollarBrace length: 1 col: 57 line: ...0x13ee ) ) (Token id: Id.Lit_Chars length: 1 col: 58 line: ...0x13ee ) ] right: (Token id: Id.Right_DoubleQuote length: 1 col: 59 line: ...0x13ee ) ) ] ) right: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote length: 1 col: 64 line: ...0x13ee ) parts: [(Token id:Id.Lit_Chars length:9 col:65 line:...0x13ee)] right: (Token id: Id.Right_DoubleQuote length: 1 col: 74 line: ...0x13ee ) ) ] ) ) ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:77 line:...0x13ee) ) terminator: (Token id:Id.Op_Semi length:1 col:79 line:...0x13ee) ) ] ) then_kw: (Token id:Id.KW_Then length:4 col:81 line:...0x13ee) action: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:3 content:" echo hi\n" src:...0x3ffffffc) ) more_env: [] words: [ (CompoundWord parts:[...0x129e]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:2 col:7 line:...0x12a6)]) ] do_fork: T ) ] then_tok: ...0x12be ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi length: 2 col: 0 line: (SourceLine line_num:4 content:"fi\n" src:...0x3ffffffc) ) ) OK test-regex-nix *** Running test-regex-pipe ===== CASE: -n -c [[ a =~ b|c ]] ===== (command.DBracket left: (Token id: Id.KW_DLeftBracket length: 2 col: 0 line: (SourceLine line_num:1 content:"[[ a =~ b|c ]]" src:(source.CFlag)) ) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:3 line:...0x13f2)]) right: (CompoundWord parts: [ (Token id:Id.Lit_Chars length:1 col:8 line:...0x13f2) (Token id:Id.Lit_Other length:1 col:9 line:...0x13f2) (Token id:Id.Lit_Chars length:1 col:10 line:...0x13f2) ] ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:12 line:...0x13f2) ) OK test-regex-pipe *** Running test-regex-right-paren ===== CASE: -n -c [[ a =~ b ]] ===== (command.DBracket left: (Token id: Id.KW_DLeftBracket length: 2 col: 0 line: (SourceLine line_num:1 content:"[[ a =~ b ]]" src:(source.CFlag)) ) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:3 line:...0x13f2)]) right: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:8 line:...0x13f2)]) ) right: (Token id:Id.Lit_DRightBracket length:2 col:10 line:...0x13f2) ) ===== CASE: -n -c [[ a =~ (b) ]] ===== (command.DBracket left: (Token id: Id.KW_DLeftBracket length: 2 col: 0 line: (SourceLine line_num:1 content:"[[ a =~ (b) ]]" src:(source.CFlag)) ) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:3 line:...0x13f2)]) right: (CompoundWord parts: [ (word_part.BashRegexGroup left: (Token id:Id.BashRegex_LParen length:1 col:8 line:...0x13f2) child: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:9 line:...0x13f2)]) right: (Token id:Id.Right_BashRegexGroup length:1 col:10 line:...0x13f2) ) ] ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:12 line:...0x13f2) ) ===== CASE: -n -c [[ (a =~ b) ]] ===== (command.DBracket left: (Token id: Id.KW_DLeftBracket length: 2 col: 0 line: (SourceLine line_num:1 content:"[[ (a =~ b) ]]" src:(source.CFlag)) ) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:4 line:...0x13f2)]) right: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:9 line:...0x13f2)]) ) right: (Token id:Id.Lit_DRightBracket length:2 col:12 line:...0x13f2) ) ===== CASE: -n -c [[ (a =~ (b)) ]] ===== (command.DBracket left: (Token id: Id.KW_DLeftBracket length: 2 col: 0 line: (SourceLine line_num:1 content:"[[ (a =~ (b)) ]]" src:(source.CFlag)) ) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:4 line:...0x13f2)]) right: (CompoundWord parts: [ (word_part.BashRegexGroup left: (Token id:Id.BashRegex_LParen length:1 col:9 line:...0x13f2) child: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:10 line:...0x13f2)]) right: (Token id:Id.Right_BashRegexGroup length:1 col:11 line:...0x13f2) ) ] ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:14 line:...0x13f2) ) ===== CASE: -n -c [[ (a =~ ( ===== [[ (a =~ ( ^ [ -c flag ]:1: Expected word after ( opening bash regex group ===== CASE: -n -c [[ (a =~ (b ===== [[ (a =~ (b ^ [ -c flag ]:1: Expected ) to close bash regex group OK test-regex-right-paren *** Running test-regex-space ===== CASE: -n -c [[ a =~ ( ) ]] ===== (command.DBracket left: (Token id: Id.KW_DLeftBracket length: 2 col: 0 line: (SourceLine line_num:1 content:"[[ a =~ ( ) ]]" src:(source.CFlag)) ) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:3 line:...0x13f2)]) right: (CompoundWord parts: [ (word_part.BashRegexGroup left: (Token id:Id.BashRegex_LParen length:1 col:8 line:...0x13f2) child: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:9 line:...0x13f2)]) right: (Token id:Id.Right_BashRegexGroup length:1 col:10 line:...0x13f2) ) ] ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:12 line:...0x13f2) ) ===== CASE: -n -c [[ a =~ (b c) ]] ===== (command.DBracket left: (Token id: Id.KW_DLeftBracket length: 2 col: 0 line: (SourceLine line_num:1 content:"[[ a =~ (b c) ]]" src:(source.CFlag)) ) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:3 line:...0x13f2)]) right: (CompoundWord parts: [ (word_part.BashRegexGroup left: (Token id:Id.BashRegex_LParen length:1 col:8 line:...0x13f2) child: (CompoundWord parts: [ (Token id:Id.Lit_Chars length:1 col:9 line:...0x13f2) (Token id:Id.Lit_Chars length:1 col:10 line:...0x13f2) (Token id:Id.Lit_Chars length:1 col:11 line:...0x13f2) ] ) right: (Token id:Id.Right_BashRegexGroup length:1 col:12 line:...0x13f2) ) ] ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:14 line:...0x13f2) ) ===== CASE: -n -c [[ a =~ (a b)(c d) ]] ===== (command.DBracket left: (Token id: Id.KW_DLeftBracket length: 2 col: 0 line: (SourceLine line_num:1 content:"[[ a =~ (a b)(c d) ]]" src:(source.CFlag)) ) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:3 line:...0x13f2)]) right: (CompoundWord parts: [ (word_part.BashRegexGroup left: (Token id:Id.BashRegex_LParen length:1 col:8 line:...0x13f2) child: (CompoundWord parts: [ (Token id:Id.Lit_Chars length:1 col:9 line:...0x13f2) (Token id:Id.Lit_Chars length:1 col:10 line:...0x13f2) (Token id:Id.Lit_Chars length:1 col:11 line:...0x13f2) ] ) right: (Token id:Id.Right_BashRegexGroup length:1 col:12 line:...0x13f2) ) (word_part.BashRegexGroup left: (Token id:Id.BashRegex_LParen length:1 col:13 line:...0x13f2) child: (CompoundWord parts: [ (Token id:Id.Lit_Chars length:1 col:14 line:...0x13f2) (Token id:Id.Lit_Chars length:1 col:15 line:...0x13f2) (Token id:Id.Lit_Chars length:1 col:16 line:...0x13f2) ] ) right: (Token id:Id.Right_BashRegexGroup length:1 col:17 line:...0x13f2) ) ] ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:19 line:...0x13f2) ) bash=0 ===== CASE: -n -c [[ a =~ (b c) ]] ===== (command.DBracket left: (Token id: Id.KW_DLeftBracket length: 2 col: 0 line: (SourceLine line_num:1 content:"[[ a =~ (b\n" src:(source.CFlag)) ) expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:3 line:...0x13ee)]) right: (CompoundWord parts: [ (word_part.BashRegexGroup left: (Token id:Id.BashRegex_LParen length:1 col:8 line:...0x13ee) child: (CompoundWord parts: [ (Token id:Id.Lit_Chars length:1 col:9 line:...0x13ee) (Token id:Id.Lit_Chars length:1 col:10 line:...0x13ee) (Token id: Id.Lit_Chars length: 1 col: 0 line: (SourceLine line_num:2 content:"c) ]]" src:...0x3ffffffc) ) ] ) right: (Token id:Id.Right_BashRegexGroup length:1 col:1 line:...0x13a2) ) ] ) ) right: (Token id:Id.Lit_DRightBracket length:2 col:3 line:...0x13a2) ) OK test-regex-space *** Running test-shell_for ===== CASE: -n -c for x in & ===== for x in & ^ [ -c flag ]:1: Invalid word in for loop ===== CASE: -n -c for (( i=0; i<10; i++ )) ls ===== for (( i=0; i<10; i++ )) ls ^~ [ -c flag ]:1: Invalid word after for expression ===== CASE: -n -c for ( i=0; i<10; i++ ) ===== for ( i=0; i<10; i++ ) ^ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: -n -c 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: -n -c 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: -n -c 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: -n -c for foo BAD ===== for foo BAD ^ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: -n -c for var in x; do echo $var; done ===== (command.ForEach keyword: (Token id: Id.KW_For length: 3 col: 0 line: (SourceLine line_num:1 content:"for var in x; do echo $var; done" src:(source.CFlag)) ) iter_names: [var] iterable: (for_iter.Words words: [(CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:11 line:...0x13fa)])] ) semi_tok: (Token id:Id.Op_Semi length:1 col:12 line:...0x13fa) body: (command.DoGroup left: (Token id:Id.KW_Do length:2 col:14 line:...0x13fa) children: [ (command.Sentence child: (command.Simple blame_tok: (Token id:Id.Lit_Chars length:4 col:17 line:...0x13fa) more_env: [] words: [ (CompoundWord parts:[...0x1396]) (CompoundWord parts: [ (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:4 col:22 line:...0x13fa) ) ] ) ] do_fork: T ) terminator: (Token id:Id.Op_Semi length:1 col:26 line:...0x13fa) ) ] right: (Token id:Id.KW_Done length:4 col:28 line:...0x13fa) ) ) OK test-shell_for *** Running test-simple-command ===== CASE: -n -c PYTHONPATH=. FOO=(1 2) python ===== PYTHONPATH=. FOO=(1 2) python ^~~~ [ -c flag ]:1: Environment bindings can't contain array literals ===== CASE: -n -c PYTHONPATH+=1 python ===== PYTHONPATH+=1 python ^~~~~~~~~~~~ [ -c flag ]:1: Expected = in environment binding, got += ===== CASE: -n -c =var ===== =var ^ [ -c flag ]:1: =word isn't allowed. Hint: add a space after =, or quote it ===== CASE: -n -c =f(x) ===== =f(x) ^ [ -c flag ]:1: =word isn't allowed. Hint: add a space after =, or quote it ===== CASE: -n -c =var ===== =var ^ [ -c flag ]:1: =word isn't allowed. Hint: add a space after =, or quote it ===== CASE: -n -c =f(x) ===== =f(x) ^ [ -c flag ]:1: =word isn't allowed. Hint: add a space after =, or quote it OK test-simple-command *** Running test-slice ===== CASE: -n -c ${foo:42} ===== (command.Simple blame_tok: (Token id:Id.Left_DollarBrace length:2 col:0 line:(SourceLine line_num:1 content:"${foo:42}" src:(source.CFlag))) more_env: [] words: [ (CompoundWord parts: [ (BracedVarSub left: ...0x13ea token: (Token id:Id.VSub_Name length:3 col:2 line:...0x13f2) var_name: foo suffix_op: (suffix_op.Slice begin: (CompoundWord parts:[(Token id:Id.Lit_Digits length:2 col:6 line:...0x13f2)]) ) right: (Token id:Id.Arith_RBrace length:1 col:8 line:...0x13f2) ) ] ) ] do_fork: T ) ===== CASE: -n -c ${foo:42+1} ===== (command.Simple blame_tok: (Token id: Id.Left_DollarBrace length: 2 col: 0 line: (SourceLine line_num:1 content:"${foo:42+1}" src:(source.CFlag)) ) more_env: [] words: [ (CompoundWord parts: [ (BracedVarSub left: ...0x13ea token: (Token id:Id.VSub_Name length:3 col:2 line:...0x13f2) var_name: foo suffix_op: (suffix_op.Slice begin: (arith_expr.Binary op: (Token id:Id.Arith_Plus length:1 col:8 line:...0x13f2) left: (CompoundWord parts:[(Token id:Id.Lit_Digits length:2 col:6 line:...0x13f2)]) right: (CompoundWord parts: [(Token id:Id.Lit_Digits length:1 col:9 line:...0x13f2)] ) ) ) right: (Token id:Id.Arith_RBrace length:1 col:10 line:...0x13f2) ) ] ) ] do_fork: T ) ===== CASE: -n -c echo ${a:1;} ===== echo ${a:1;} ^ [ -c flag ]:1: Expected : or } in slice ===== CASE: -n -c echo ${a:1:2;} ===== echo ${a:1:2;} ^ [ -c flag ]:1: Unexpected token after arithmetic expression (Id.Arith_Semi != Id.Arith_RBrace) OK test-slice *** Running test-test-builtin ===== CASE: -c [ x -a y f ] ===== [ x -a y f ] ^ [ -c flag ]:1: (test) Unexpected trailing word 'f' ===== CASE: -c test x -a y f ===== test x -a y f ^ [ -c flag ]:1: (test) Unexpected trailing word 'f' ===== CASE: -c [ x ===== [ x ^ [ -c flag ]:1: missing closing ] ===== CASE: -c [ x x ] ===== [ x x ] ^ [ -c flag ]:1: (test) Expected unary operator, got 'x' (2 args) ===== CASE: -c [ x x "a b" ] ===== [ x x "a b" ] ^ [ -c flag ]:1: (test) Expected binary operator, got 'x' (3 args) ===== CASE: -c [ -t xxx ] ===== [ -t xxx ] ^~~ [ -c flag ]:1: (test) Invalid file descriptor 'xxx' ===== CASE: -c [ \( x -a -y -a z ] ===== [??? no location ???] (test) Expected ), got EOF OK test-test-builtin *** Running test-word-parse ===== CASE: -n -c echo ${ ===== echo ${ ^ [ -c flag ]:1: Unexpected token in ${} ===== CASE: -n -c echo ${a[@Z ===== echo ${a[@Z ^ [ -c flag ]:1: Expected ] to close subscript ===== CASE: -n -c echo ${x.} ===== echo ${x.} ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c echo ${!x.} ===== echo ${!x.} ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c echo ${#a. ===== echo ${#a. ^ [ -c flag ]:1: Expected } after length expression ===== CASE: -n -c for (( i = 0; i < 10; i++ ; ===== for (( i = 0; i < 10; i++ ; ^ [ -c flag ]:1: Unexpected token after arithmetic expression (Id.Arith_Semi != Id.Arith_RParen) ===== CASE: -n -c for (( i = 0; i < 10; i++ / ===== for (( i = 0; i < 10; i++ / ^ [ -c flag ]:1: Unexpected end of input ===== CASE: -n -c echo @(extglob|foo ===== echo @(extglob|foo ^~ [ -c flag ]:1: Unexpected EOF reading extended glob that began here ===== CASE: -n -c ${undef:- ===== ${undef:- ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c ${undef:-$ ===== ${undef:-$ ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c ${undef:-$F ===== ${undef:-$F ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c ${x@ ===== ${x@ ^ [ -c flag ]:1: Unexpected token in ${} (VOp3) ===== CASE: -n -c ${x@Q ===== ${x@Q ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c ${x% ===== ${x% ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c ${x/ ===== ${x/ ^ [ -c flag ]:1: Expected } after replacement string, got Id.Eof_Real ===== CASE: -n -c ${x/a/ ===== ${x/a/ ^ [ -c flag ]:1: Expected } after replacement string, got Id.Eof_Real ===== CASE: -n -c ${x/a/b ===== ${x/a/b ^ [ -c flag ]:1: Expected } after replacement string, got Id.Eof_Real ===== CASE: -n -c ${x: ===== ${x: ^ [ -c flag ]:1: Unexpected end of input OK test-word-parse test/parse-errors.sh: 36 tests passed.