~/git/oilshell/oil/opy/_tmp/repo-with-opy ~/git/oilshell/oil/opy asdl/arith_ast_test.pyc ......... ---------------------------------------------------------------------- Ran 9 tests in 0.010s OK -- COMPOUND SUM -- (ArithVar name:x) (ArithVar name:y) Encoding into binary: (Const i:99) (Slice a:(ArithVar name:foo)) (FuncCall name:f) (Const i:66) (Slice a:(Const i:1) begin:(Const i:5) end:(Const i:2)) -- PRODUCT -- (source_location path:hi line:1 col:2 length:3) -- SIMPLE SUM -- asdl/arith_parse_test.pyc (ArithBinary op_id: Plus left: (ArithBinary op_id:Plus left:(Const i:1) right:(Const i:2)) right: (Const i:3) ) (ArithBinary op_id: Plus left: (Const i:1) right: (ArithBinary op_id:Star left:(Const i:2) right:(Const i:3)) ) (ArithBinary op_id: Star left: (Const i:4) right: (ArithBinary op_id:Plus left:(Const i:2) right:(Const i:3)) ) (ArithBinary op_id: Star left: (ArithBinary op_id:Plus left:(Const i:2) right:(Const i:3)) right: (Const i:4) ) asdl/encode_test.pyc . ---------------------------------------------------------------------- Ran 1 test in 0.002s OK asdl/format_test.pyc .. ---------------------------------------------------------------------- Ran 2 tests in 0.007s OK (assign name:declare flags:[-r -x]) Plus asdl/py_meta_test.pyc . ---------------------------------------------------------------------- Ran 1 test in 0.000s OK asdl/unpickle_test.pyc {'StringWord': >), ('s', ), ('spids', >)]>, 'FuncDef': ), ('body', ), ('redirects', >), ('spids', >)]>, 'Until': >), ('body', ), ('redirects', >), ('spids', >)]>, 'glob_part': , 'Assignment': >), ('flags', >), ('pairs', ), ('op', ), ('rhs', >), ('spids', >)]>>), ('spids', >)]>, 'ArrayPair': ), ('value', ), ('spids', >)]>, 'ArrayIndex': ), ('spids', >)]>, 'LogicalAnd': ), ('right', ), ('spids', >)]>, 'UnaryAssign': >), ('child', ), ('spids', >)]>, 'partial_file': ), ('funcs', >), ('spans', ), ('col', ), ('length', ), ('spids', >)]>>), ('root', ), ('spids', >)]>>), ('spids', >)]>, 'string': , 'lhs_expr': , 'While': >), ('body', ), ('redirects', >), ('spids', >)]>, 'LhsIndexedName': ), ('index', ), ('spids', >)]>, 'BracedAltPart': >), ('spids', >)]>, 'DoGroup': >), ('redirects', >), ('spids', >)]>, 'BracedWordTree': >), ('spids', >)]>, 'BoolBinary': >), ('left', ), ('right', ), ('spids', >)]>, 'ExtGlobPart': >), ('val', ), ('span_id', ), ('spids', >)]>), ('arms', >), ('spids', >)]>, 'LhsName': ), ('spids', >)]>, 'Sentence': ), ('terminator', >), ('val', ), ('span_id', ), ('spids', >)]>), ('spids', >)]>, 'ArrayWord': ), ('spids', >)]>, 'PlusEqual': , 'token': >), ('val', ), ('span_id', ), ('spids', >)]>, 'NoOp': , 'GlobOp': >), ('spids', >)]>, 'TernaryOp': ), ('true_expr', ), ('false_expr', ), ('spids', >)]>, 'BracedIntRangePart': ), ('end', ), ('step', ), ('negated', ), ('spids', >)]>>), ('spids', >)]>, 'braced_step': ), ('negated', ), ('spids', >)]>, 'case_arm': >), ('action', >), ('spids', >)]>, 'redir': , 'word_part': , 'ForExpr': >), ('cond', >), ('update', >), ('body', >), ('redirects', >), ('spids', >)]>, 'Subshell': ), ('redirects', >), ('spids', >)]>, 'BracedVarSub': >), ('val', ), ('span_id', ), ('spids', >)]>), ('prefix_op', >>), ('bracket_op', >), ('suffix_op', >), ('spids', >)]>, 'WordTest': ), ('spids', >)]>, 'assign_op': , 'ArithBinary': >), ('left', ), ('right', ), ('spids', >)]>, 'ArithSubPart': ), ('spids', >)]>, 'if_arm': >), ('action', >), ('spids', >)]>, 'arith_expr': , 'HereDoc': >), ('val', ), ('span_id', ), ('spids', >)]>), ('fd', ), ('here_begin', ), ('here_end_span_id', ), ('stdin_parts', >), ('spids', >)]>, 'SimpleVarSub': >), ('val', ), ('span_id', ), ('spids', >)]>), ('spids', >)]>, 'TildeSubPart': >), ('val', ), ('span_id', ), ('spids', >)]>), ('spids', >)]>, 'EmptyPart': , 'GlobLit': >), ('s', ), ('spids', >)]>, 'AndOr': >>), ('children', >), ('spids', >)]>, 'CommandList': >), ('spids', >)]>, 'DParen': ), ('redirects', >), ('spids', >)]>, 'StringUnary': >), ('arg_word', ), ('spids', >)]>, 'PatSub': ), ('replace', >), ('do_all', ), ('do_prefix', ), ('do_suffix', ), ('spids', >)]>, 'BinaryAssign': >), ('left', ), ('right', ), ('spids', >)]>, 'LiteralPart': >), ('val', ), ('span_id', ), ('spids', >)]>), ('spids', >)]>, 'iterable': , 'ArrayLiteralPart': >), ('spids', >)]>, 'TokenWord': >), ('val', ), ('span_id', ), ('spids', >)]>), ('spids', >)]>, 'CompoundWord': >), ('spids', >)]>, 'int': , 'assign_pair': ), ('op', ), ('rhs', >), ('spids', >)]>, 'IterArgv': , 'arena': >), ('spans', ), ('col', ), ('length', ), ('spids', >)]>>), ('root', ), ('spids', >)]>, 'Pipeline': >), ('negated', ), ('stderr_indices', >), ('spids', >)]>, 'SingleQuotedPart': >), ('val', ), ('span_id', ), ('spids', >)]>), ('tokens', >), ('val', ), ('span_id', ), ('spids', >)]>>), ('spids', >)]>, 'whole_file': ), ('a', >), ('spans', ), ('col', ), ('length', ), ('spids', >)]>>), ('root', ), ('spids', >)]>), ('spids', >)]>, 'bool_expr': , 'array_item': , 'SimpleCommand': >), ('redirects', >), ('more_env', ), ('val', ), ('spids', >)]>>), ('spids', >)]>, 'ArithUnary': >), ('child', ), ('spids', >)]>, 'If': >), ('action', >), ('spids', >)]>>), ('else_action', >), ('redirects', >), ('spids', >)]>, 'CommandSubPart': ), ('left_token', >), ('val', ), ('span_id', ), ('spids', >)]>), ('spids', >)]>, 'line_span': ), ('col', ), ('length', ), ('spids', >)]>, 'BracedCharRangePart': ), ('end', ), ('step', ), ('negated', ), ('spids', >)]>>), ('spids', >)]>, 'word': , 'LogicalOr': ), ('right', ), ('spids', >)]>, 'DoubleQuotedPart': >), ('spids', >)]>, 'Slice': >), ('length', >), ('spids', >)]>, 'FuncCall': ), ('args', >), ('spids', >)]>, 'bracket_op': , 'ControlFlow': >), ('val', ), ('span_id', ), ('spids', >)]>), ('arg_word', >), ('spids', >)]>, 'ArithVarRef': ), ('spids', >)]>, 'Redir': >), ('val', ), ('span_id', ), ('spids', >)]>), ('fd', ), ('arg_word', ), ('spids', >)]>, 'DBracket': ), ('redirects', >), ('spids', >)]>, 'EscapedLiteralPart': >), ('val', ), ('span_id', ), ('spids', >)]>), ('spids', >)]>, 'id': >, 'bool': , 'suffix_op': , 'Case': ), ('arms', >), ('action', >), ('spids', >)]>>), ('redirects', >), ('spids', >)]>, 'TimeBlock': ), ('spids', >)]>, 'BoolUnary': >), ('child', ), ('spids', >)]>, 'Equal': , 'env_pair': ), ('val', ), ('spids', >)]>, 'IterArray': >), ('spids', >)]>, 'BraceGroup': >), ('redirects', >), ('spids', >)]>, 'LogicalNot': ), ('spids', >)]>, 'command': , 'ForEach': ), ('iter_words', >), ('do_arg_iter', ), ('body', ), ('redirects', >), ('spids', >)]>, 'WholeArray': >), ('spids', >)]>, 'ArithWord': ), ('spids', >)]>, 'CharClass': ), ('strs', >), ('spids', >)]>} core/alloc_test.pyc .. ---------------------------------------------------------------------- Ran 2 tests in 0.005s OK core/args_test.pyc ..... ---------------------------------------------------------------------- Ran 5 tests in 0.042s OK <_Attributes {'c': 'echo hi', 'help': None, 'i': None, 'ast_format': None, 'rcfile': None, 'opt_changes': [('errexit', True), ('nounset', True)], 'saw_double_dash': False}> ['foo', '--help'] <_Attributes {'c': None, 'help': None, 'i': None, 'ast_format': None, 'rcfile': None, 'opt_changes': [('errexit', False), ('nounset', False), ('pipefail', True)], 'saw_double_dash': False}> ['foo'] core/braces_test.pyc --- } {(Lit_RBrace '}')} --- , {(Lit_Comma ',')} --- B-{a,b}-E {(B-) (Lit_LBrace '{') (a) (Lit_Comma ',') (b) (Lit_RBrace '}') (-E)} (BracedWordTree parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (BracedAltPart words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:2))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:4))]) ] ) (LiteralPart token:(token id:Lit_Chars val:-E span_id:6)) ] ) -- --- B-{a"a",b"b",c"c"}-E {(B-) (Lit_LBrace '{') (a) (DQ (a)) (Lit_Comma ',') (b) (DQ (b)) (Lit_Comma ',') (c) (DQ (c)) (Lit_RBrace '}') (-E) } (BracedWordTree parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (BracedAltPart words: [ (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:a span_id:2)) (DoubleQuotedPart parts: [(LiteralPart token:(token id:Lit_Chars val:a span_id:4))] spids: [3 5] ) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:b span_id:7)) (DoubleQuotedPart parts: [(LiteralPart token:(token id:Lit_Chars val:b span_id:9))] spids: [8 10] ) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:c span_id:12)) (DoubleQuotedPart parts: [(LiteralPart token:(token id:Lit_Chars val:c span_id:14))] spids: [13 15] ) ] ) ] ) (LiteralPart token:(token id:Lit_Chars val:-E span_id:17)) ] ) -- --- B-{a,b}--{c,d}-E {(B-) (Lit_LBrace '{') (a) (Lit_Comma ',') (b) (Lit_RBrace '}') (--) (Lit_LBrace '{') (c) (Lit_Comma ',') (d) (Lit_RBrace '}') (-E) } (BracedWordTree parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (BracedAltPart words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:2))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:4))]) ] ) (LiteralPart token:(token id:Lit_Chars val:-- span_id:6)) (BracedAltPart words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:c span_id:8))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:d span_id:10))]) ] ) (LiteralPart token:(token id:Lit_Chars val:-E span_id:12)) ] ) -- --- B-{a,b,c,={d,e}}-E {(B-) (Lit_LBrace '{') (a) (Lit_Comma ',') (b) (Lit_Comma ',') (c) (Lit_Comma ',') (Lit_Other '=') (Lit_LBrace '{') (d) (Lit_Comma ',') (e) (Lit_RBrace '}') (Lit_RBrace '}') (-E) } (BracedWordTree parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (BracedAltPart words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:2))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:4))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:c span_id:6))]) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Other val:'=' span_id:8)) (BracedAltPart words: [ (CompoundWord parts: [(LiteralPart token:(token id:Lit_Chars val:d span_id:10))] ) (CompoundWord parts: [(LiteralPart token:(token id:Lit_Chars val:e span_id:12))] ) ] ) ] ) ] ) (LiteralPart token:(token id:Lit_Chars val:-E span_id:15)) ] ) --- B-{a,={b,c}=,d}-E {(B-) (Lit_LBrace '{') (a) (Lit_Comma ',') (Lit_Other '=') (Lit_LBrace '{') (b) (Lit_Comma ',') (c) (Lit_RBrace '}') (Lit_Other '=') (Lit_Comma ',') (d) (Lit_RBrace '}') (-E) } (BracedWordTree parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (BracedAltPart words: [ (CompoundWord parts:[(LiteralPart token:(to.ken id:Lit_Chars val:a span_id:2))]) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Other val:'=' span_id:4)) (BracedAltPart words: [ (CompoundWord parts: [(LiteralPart token:(token id:Lit_Chars val:b span_id:6))] ) (CompoundWord parts: [(LiteralPart token:(token id:Lit_Chars val:c span_id:8))] ) ] ) (LiteralPart token:(token id:Lit_Other val:'=' span_id:10)) ] ) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:d span_id:12))]) ] ) (LiteralPart token:(token id:Lit_Chars val:-E span_id:14)) ] ) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:2))]) --- {a,b,} {(Lit_LBrace '{') (a) (Lit_Comma ',') (b) (Lit_Comma ',') (Lit_RBrace '}')} (BracedWordTree parts: [ (BracedAltPart words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:1))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:3))]) (CompoundWord) ] ) ] ) --- hi {(hi)} (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:hi span_id:0))]) --- B-{a,b}-E {(B-) (Lit_LBrace '{') (a) (Lit_Comma ',') (b) (Lit_RBrace '}') (-E)} (BracedWordTree parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (BracedAltPart words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:2))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:4))]) ] ) (LiteralPart token:(token id:Lit_Chars val:-E span_id:6)) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Chars val:a span_id:2)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:6)) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Chars val:b span_id:4)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:6)) ] ) --- B-{a,={b,c,d}=,e}-E {(B-) (Lit_LBrace '{') (a) (Lit_Comma ',') (Lit_Other '=') (Lit_LBrace '{') (b) (Lit_Comma ',') (c) (Lit_Comma ',') (d) (Lit_RBrace '}') (Lit_Other '=') (Lit_Comma ',') (e) (Lit_RBrace '}') (-E) } (BracedWordTree parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (BracedAltPart words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:2))]) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Other val:'=' span_id:4)) (BracedAltPart words: [ (CompoundWord parts: [(LiteralPart token:(token id:Lit_Chars val:b span_id:6))] ) (CompoundWord parts: [(LiteralPart token:(token id:Lit_Chars val:c span_id:8))] ) (CompoundWord parts: [(LiteralPart token:(token id:Lit_Chars val:d span_id:10))] ) ] ) (LiteralPart token:(token id:Lit_Other val:'=' span_id:12)) ] ) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:e span_id:14))]) ] ) (LiteralPart token:(token id:Lit_Chars val:-E span_id:16)) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Chars val:a span_id:2)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:16)) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Other val:'=' span_id:4)) (LiteralPart token:(token id:Lit_Chars val:b span_id:6)) (LiteralPart token:(token id:Lit_Other val:'=' span_id:12)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:16)) ] ) (CompoundWord parts: [ (LiteralPart to. ---------------------------------------------------------------------- Ran 2 tests in 1.621s OK ken:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Other val:'=' span_id:4)) (LiteralPart token:(token id:Lit_Chars val:c span_id:8)) (LiteralPart token:(token id:Lit_Other val:'=' span_id:12)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:16)) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Other val:'=' span_id:4)) (LiteralPart token:(token id:Lit_Chars val:d span_id:10)) (LiteralPart token:(token id:Lit_Other val:'=' span_id:12)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:16)) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Chars val:e span_id:14)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:16)) ] ) --- B-{a,b}-{c,d}-E {(B-) (Lit_LBrace '{') (a) (Lit_Comma ',') (b) (Lit_RBrace '}') (-) (Lit_LBrace '{') (c) (Lit_Comma ',') (d) (Lit_RBrace '}') (-E) } (BracedWordTree parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (BracedAltPart words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:2))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:4))]) ] ) (LiteralPart token:(token id:Lit_Chars val:- span_id:6)) (BracedAltPart words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:c span_id:8))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:d span_id:10))]) ] ) (LiteralPart token:(token id:Lit_Chars val:-E span_id:12)) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Chars val:a span_id:2)) (LiteralPart token:(token id:Lit_Chars val:- span_id:6)) (LiteralPart token:(token id:Lit_Chars val:c span_id:8)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:12)) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Chars val:a span_id:2)) (LiteralPart token:(token id:Lit_Chars val:- span_id:6)) (LiteralPart token:(token id:Lit_Chars val:d span_id:10)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:12)) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Chars val:b span_id:4)) (LiteralPart token:(token id:Lit_Chars val:- span_id:6)) (LiteralPart token:(token id:Lit_Chars val:c span_id:8)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:12)) ] ) (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Chars val:B- span_id:0)) (LiteralPart token:(token id:Lit_Chars val:b span_id:4)) (LiteralPart token:(token id:Lit_Chars val:- span_id:6)) (LiteralPart token:(token id:Lit_Chars val:d span_id:10)) (LiteralPart token:(token id:Lit_Chars val:-E span_id:12)) ] ) core/builtin_test.pyc . ---------------------------------------------------------------------- Ran 1 test in 0.008s OK --- 'Aa b \\ a\\ b' 2 3 4 5 6 8 9 11 --- --- 'a b c ' 1 2 3 4 5 --- core/cmd_exec_test.pyc (CommandList children: [ (SimpleCommand words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:echo span_id:0))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:hi span_id:2))]) ] ) ] ) hi ... ---------------------------------------------------------------------- Ran 3 tests in 0.055s OK 0 (CommandList children: [ (SimpleCommand words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:echo span_id:0))]) (BracedWordTree parts: [ (LiteralPart token:(token id:Lit_Chars val:_ span_id:2)) (BracedAltPart words: [ (CompoundWord parts: [(LiteralPart token:(token id:Lit_Chars val:a span_id:4))] ) (CompoundWord parts: [(LiteralPart token:(token id:Lit_Chars val:b span_id:6))] ) ] ) (LiteralPart token:(token id:Lit_Chars val:_ span_id:8)) ] ) ] ) ] ) [(StringPartValue s:'' do_split_glob:T)] [(StringPartValue s:xxx do_split_glob:T)] [(StringPartValue s:default do_split_glob:T)] [(StringPartValue s:xxx do_split_glob:T)] core/completion_test.pyc ..........[] ] at 0x7faef8ca0d70> '' ''> at 0x7faef8cb29b0> '' ''> py ] at 0x7faef8ca0d70> '' ''> rb at 0x7faef8cb29b0> '' ''> Completing 'grep f' ... (Ctrl-C to cancel) ... 1 match for 'grep f' in 0.00 seconds (Ctrl-C to cancel) ... 2 matches for 'grep f' in 0.00 seconds (Ctrl-C to cancel) Found 2 matches for 'grep f' in 0.00 seconds Completing 'grep g' ... (Ctrl-C to cancel) Found 0 matches for 'grep g' in 0.00 seconds Completing 'ls $v' ... (Ctrl-C to cancel) ... 1 match for 'ls $v' in 0.00 seconds (Ctrl-C to cancel) ... 2 matches for 'ls $v' in 0.00 seconds (Ctrl-C to cancel) Found 2 matches for 'ls $v' in 0.00 seconds Completing 'g' ... (Ctrl-C to cancel) ... 1 match for 'g' in 0.00 seconds (Ctrl-C to cancel) Found 1 match for 'g' in 0.00 seconds Completing '' ... (Ctrl-C to cancel) ... 1 match for '' in 0.00 seconds (Ctrl-C to cancel) ... 2 matches for '' in 0.00 seconds (Ctrl-C to cancel) ... 3 matches for '' in 0.00 seconds (Ctrl-C to cancel) Found 3 matches for '' in 0.00 seconds Completing 'echo hi || grep f' ... (Ctrl-C to cancel) Found 0 matches for 'echo hi || grep f' in 0.00 seconds Completing 'echo hi; grep f' ... (Ctrl-C to cancel) Found 0 matches for 'echo hi; grep f' in 0.00 seconds Completing '{ echo hi; grep f' ... (Ctrl-C to cancel) Found 0 matches for '{ echo hi; grep f' in 0.00 seconds Completing 'var=$v' ... (Ctrl-C to cancel) Found 0 matches for 'var=$v' in 0.00 seconds Completing 'local var=$v' ... (Ctrl-C to cancel) Found 0 matches for 'local var=$v' in 0.00 seconds REPLY ['f1', 'f2'] ['foo.py ', 'foo '] --- echo $( (, '', []) --- echo $(ls (, '', []) --- echo $(ls foo (, '', []) --- ls (, '', []) --- ls (, '', []) --- cat < (, '', []) --- cat , '', []) --- time (, '', []) --- time (, '', []) --- time echo (, '', []) --- ls | (, '', []) --- ls | wc -l (, '', []) --- ls && (, '', []) --- ls && echo (, '', []) --- echo a; (, '', []) --- echo a; echo (, '', []) --- { echo hi; (, '', []) --- { echo hi; echo (, '', []) --- { echo hi; echo bye; (, '', []) --- ( echo hi (, '', []) --- ( echo hi; echo (, '', []) --- f() { (, '', []) --- f() { echo (, '', []) --- f() { echo hi; (, '', []) --- if (, '', []) --- if (, '', []) --- if test (, '', []) --- while (, '', []) --- while (, '', []) --- while test (, '', []) --- case $foo (, '', []) --- case $foo in a) (, '', []) --- case $foo in a) echo (, '', []) --- (, '', []) --- (, '', []) --- echo $ (, '', []) --- echo $f (, '', []) --- echo "$ (, '', []) --- echo "$f (, '', []) --- echo '${ (, '', []) --- echo '${f (, '', []) --- echo $(ls $ (, '', []) --- echo $(ls $f (, '. ---------------------------------------------------------------------- Ran 11 tests in 1.013s OK ', []) core/glob_test.pyc ...... ---------------------------------------------------------------------- Ran 6 tests in 0.150s OK [] [(Glob_Star, '*'), (Glob_OtherLiteral, '.'), (Glob_CleanLiterals, 'py')] [(Glob_EscapedChar, '\\*'), (Glob_OtherLiteral, '.'), (Glob_CleanLiterals, 'py')] [(Glob_LBracket, '['), (Glob_CleanLiterals, 'abc'), (Glob_RBracket, ']')] [(Glob_BadBackslash, '\\')] [(Glob_EscapedChar, '\\x')] [(Glob_EscapedChar, '\\\\')] [(Glob_LBracket, '['), (Glob_LBracket, '['), (Glob_OtherLiteral, ':'), (Glob_CleanLiterals, 'alpha'), (Glob_OtherLiteral, ':'), (Glob_RBracket, ']'), (Glob_RBracket, ']')] [(Glob_LBracket, '['), (Glob_QMark, '?'), (Glob_RBracket, ']')] === *.py regex : .*\.py warnings: [] === *.? regex : .*\.. warnings: [] === <*> regex : <.*> warnings: [] === \**+ regex : \*.*\+ warnings: [] === \** regex : \*.* warnings: [] === *.[ch]pp regex : .*\.[ch]pp warnings: [] === abc regex : None warnings: [] === \* regex : None warnings: [] === c:\foo regex : None warnings: [] === strange]one regex : None warnings: ['Got unescaped right bracket'] === [[:space:]abc] regex : [[:space:]abc] warnings: [] === [abc] regex : [abc] warnings: [] === [\a\b\c] regex : [\a\b\c] warnings: [] === [abc\[] regex : [abc\[] warnings: [] === [!not] regex : [^not] warnings: [] === [^also_not] regex : [^also_not] warnings: [] === [!*?!\[] regex : [^*?!\[] warnings: [] === [!\]foo] regex : [^\]foo] warnings: [] === not_closed[a-z regex : None warnings: ['Malformed character class; treating as literal'] === [[:spa[ce:]] regex : None warnings: ['Malformed character class; treating as literal'] === [ regex : None warnings: ['Malformed character class; treating as literal'] === \ regex : None warnings: ['Got unescaped trailing backslash'] === ] regex : None warnings: ['Got unescaped right bracket'] core/id_kind_test.pyc .Char_OneChar Char_OneChar True ['Arith_Amp', 'Arith_AmpEqual', 'Arith_Bang', 'Arith_Caret', 'Arith_CaretEqual', 'Arith_Colon', 'Arith_Comma', 'Arith_DAmp', 'Arith_DEqual', 'Arith_DGreat', 'Arith_DGreatEqual', 'Arith_DLess', 'Arith_DLessEqual', 'Arith_DMinus', 'Arith_DPipe', 'Arith_DPlus', 'Arith_DStar', 'Arith_Equal', 'Arith_Great', 'Arith_GreatEqual', 'Arith_LBracket', 'Arith_LParen', 'Arith_Less', 'Arith_LessEqual', 'Arith_Minus', 'Arith_MinusEqual', 'Arith_NEqual', 'Arith_Percent', 'Arith_PercentEqual', 'Arith_Pipe', 'Arith_PipeEqual', 'Arith_Plus', 'Arith_PlusEqual', 'Arith_QMark', 'Arith_RBrace', 'Arith_RBracket', 'Arith_RParen', 'Arith_Semi', 'Arith_Slash', 'Arith_SlashEqual', 'Arith_Star', 'Arith_StarEqual', 'Arith_Tilde', 'Assign_Declare', 'Assign_Local', 'Assign_None', 'Assign_Readonly', 'Assign_Typeset', 'BoolBinary_DEqual', 'BoolBinary_Equal', 'BoolBinary_EqualTilde', 'BoolBinary_GlobDEqual', 'BoolBinary_GlobEqual', 'BoolBinary_GlobNEqual', 'BoolBinary_NEqual', 'BoolBinary_ef', 'BoolBinary_eq', 'BoolBinary_ge', 'BoolBinary_gt', 'BoolBinary_le', 'BoolBinary_lt', 'BoolBinary_ne', 'BoolBinary_nt', 'BoolBinary_ot', 'BoolUnary_G', 'BoolUnary_L', 'BoolUnary_N', 'BoolUnary_O', 'BoolUnary_R', 'BoolUnary_S', 'BoolUnary_a', 'BoolUnary_b', 'BoolUnary_c', 'BoolUnary_d', 'BoolUnary_e', 'BoolUnary_f', 'BoolUnary_g', 'BoolUnary_h', 'BoolUnary_n', 'BoolUnary_o', 'BoolUnary_p', 'BoolUnary_r', 'BoolUnary_s', 'BoolUnary_t', 'BoolUnary_u', 'BoolUnary_v', 'BoolUnary_w', 'BoolUnary_x', 'BoolUnary_z', 'Char_BadBackslash', 'Char_Hex', 'Char_Literals', 'Char_Octal3', 'Char_Octal4', 'Char_OneChar', 'Char_Stop', 'Char_Unicode4', 'Char_Unicode8', 'ControlFlow_Break', 'ControlFlow_Continue', 'ControlFlow_Exit', 'ControlFlow_Return', 'Eof_Backtick', 'Eof_RParen', 'Eof_Real', 'Eol_Tok', 'ExtGlob_At', 'ExtGlob_Bang', 'ExtGlob_Plus', 'ExtGlob_QMark', 'ExtGlob_Star', 'Glob_BadBackslash', 'Glob_Bang', 'Glob_Caret', 'Glob_CleanLiterals', 'Glob_Eof', 'Glob_EscapedChar', 'Glob_LBracket', 'Glob_OtherLiteral', 'Glob_QMark', 'Glob_RBracket', 'Glob_Star', 'Ignored_Comment', 'Ignored_LineCont', 'Ignored_Space', 'KW_Bang', 'KW_Case', 'KW_DLeftBracket', 'KW_Do', 'KW_Done', 'KW_Elif', 'KW_Else', 'KW_Esac', 'KW_Fi', 'KW_For', 'KW_Function', 'KW_If', 'KW_In', 'KW_Then', 'KW_Time', 'KW_Until', 'KW_While', 'Left_ArithSub', 'Left_ArithSub2', 'Left_Backtick', 'Left_CommandSub', 'Left_DollarDoubleQuote', 'Left_DollarSingleQuote', 'Left_DoubleQuote', 'Left_ProcSubIn', 'Left_ProcSubOut', 'Left_SingleQuote', 'Left_VarSub', 'Lit_ArithVarLike', 'Lit_At', 'Lit_Chars', 'Lit_Comma', 'Lit_DRightBracket', 'Lit_Digits', 'Lit_EscapedChar', 'Lit_LBrace', 'Lit_Other', 'Lit_Percent', 'Lit_Pound', 'Lit_RBrace', 'Lit_Slash', 'Lit_TildeLike', 'Lit_VarLike', 'Node_AndOr', 'Node_ArithVar', 'Node_Assign', 'Node_BinaryExpr', 'Node_Block', 'Node_Command', 'Node_ConstInt', 'Node_ForEach', 'Node_ForExpr', 'Node_Fork', 'Node_FuncCall', 'Node_FuncDef', 'Node_NoOp', 'Node_PostDMinus', 'Node_PostDPlus', 'Node_Subshell', 'Node_TernaryExpr', 'Node_UnaryExpr', 'Node_UnaryMinus', 'Node_UnaryPlus', 'Op_Amp', 'Op_DAmp', 'Op_DLeftParen', 'Op_DPipe', 'Op_DRightParen', 'Op_DSemi', 'Op_LParen', 'Op_Newline', 'Op_Pipe', 'Op_PipeAmp', 'Op_RParen', 'Op_Semi', 'Redir_AndDGreat', 'Redir_AndGreat', 'Redir_Clobber', 'Redir_DGreat', 'Redir_DLess', 'Redir_DLessDash', 'Redir_Great', 'Redir_GreatAnd', 'Redir_Less', 'Redir_LessAnd', 'Redir_LessGreat', 'Redir_TLess', 'Right_ArithSub', 'Right_ArrayLiteral', 'Right_Backtick', 'Right_CasePat', 'Right_CommandSub', 'Right_DollarDoubleQuote', 'Right_DollarSingleQuote', 'Right_DoubleQuote', 'Right_ExtGlob', 'Right_FuncDef', 'Right_SingleQuote', 'Right_Subshell', 'Right_VarSub', 'Undefined_Tok', 'Unknown_Tok', 'VOp1_Caret', 'VOp1_Comma', 'VOp1_DCaret', 'VOp1_DComma', 'VOp1_DPercent', 'VOp1_DPound', 'VOp1_Percent', 'VOp1_Pound', 'VOp2_Colon', 'VOp2_LBracket', 'VOp2_RBracket', 'VOp2_Slash', 'VSub_At', 'VSub_Bang', 'VSub_Dollar', 'VSub_Hyphen', 'VSub_Name', 'VSub_Number', 'VSub_Pound', 'VSub_QMark', 'VSub_Star', 'VTest_ColonEquals', 'VTest_ColonHyphen', 'VTest_ColonPlus', '.... ---------------------------------------------------------------------- Ran 5 tests in 0.019s OK VTest_ColonQMark', 'VTest_Equals', 'VTest_Hyphen', 'VTest_Plus', 'VTest_QMark', 'WS_Space', 'Word_Compound', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__'] Op_Newline Undefined_Tok {'-G': BoolUnary_G, '-L': BoolUnary_L, '-O': BoolUnary_O, '-N': BoolUnary_N, '-S': BoolUnary_S, '-R': BoolUnary_R, '-e': BoolUnary_e, '-d': BoolUnary_d, '-g': BoolUnary_g, '-f': BoolUnary_f, '-a': BoolUnary_a, '-c': BoolUnary_c, '-b': BoolUnary_b, '-o': BoolUnary_o, '-n': BoolUnary_n, '-h': BoolUnary_h, '-u': BoolUnary_u, '-t': BoolUnary_t, '-w': BoolUnary_w, '-v': BoolUnary_v, '-p': BoolUnary_p, '-s': BoolUnary_s, '-r': BoolUnary_r, '-x': BoolUnary_x, '-z': BoolUnary_z} STATS: 255 tokens in 26 groups: [1, 1, 1, 3, 3, 1, 15, 12, 12, 11, 13, 5, 9, 8, 8, 4, 43, 20, 1, 17, 5, 4, 9, 11, 25, 13] 13 BIG groups: [9, 9, 11, 11, 12, 12, 13, 13, 15, 17, 20, 25, 43] BoolUnary_b BoolUnary_c Redir_Less BoolUnary_d BoolUnary_e BoolBinary_nt BoolUnary_f BoolUnary_g Op_DAmp BoolUnary_h BoolBinary_Equal BoolUnary_L BoolBinary_GlobDEqual BoolUnary_p BoolUnary_r BoolBinary_ot BoolUnary_s BoolUnary_S Op_DPipe BoolUnary_u BoolUnary_w BoolUnary_x BoolUnary_O BoolUnary_G BoolBinary_NEqual BoolUnary_N BoolUnary_z BoolBinary_DEqual BoolUnary_n BoolBinary_GlobNEqual BoolBinary_eq BoolBinary_ne BoolBinary_GlobEqual BoolBinary_gt BoolBinary_ge KW_Bang BoolBinary_lt BoolBinary_le BoolBinary_ef BoolUnary_o Redir_Great BoolUnary_t BoolUnary_v BoolUnary_R BoolUnary_a BoolBinary_EqualTilde Op_Newline (token id:Op_Newline val:'\n' span_id:None) Op_Newline 3 9 -- Arith 16 Assign 20 BoolBinary 25 BoolUnary 24 Char 22 ControlFlow 21 Eof 3 Eol 2 ExtGlob 11 Glob 23 Ignored 4 KW 19 Left 9 Lit 6 Node 17 Op 7 Redir 8 Right 10 Undefined 0 Unknown 1 VOp1 14 VOp2 15 VSub 12 VTest 13 WS 5 Word 18 Number of Kinds: 26 Number of IDs: 258 ['AddBoolKinds', 'AddKinds', 'IdSpec', 'SetupTestBuiltin', '_BINARY_INT', '_BINARY_PATH', '_Dash', '_UNARY_OTHER_CHARS', '_UNARY_PATH_CHARS', '_UNARY_STR_CHARS', '__builtins__', '__doc__', '__file__', '__name__', '__package__', 'log', 'util'] core/legacy_test.pyc ...... ---------------------------------------------------------------------- Ran 6 tests in 0.083s OK '' PARTS [] 'a' 1 PARTS ['a'] ' a ' 1 2 PARTS ['a'] '\tab\n' 1 3 PARTS ['ab'] 'a b\n' 1 3 4 PARTS ['a', 'b'] 'a\\ b' 1 2 4 PARTS ['a b'] 'a\\ b' 2 3 4 PARTS ['a\\', 'b'] '\\\\*.sh' 1 6 PARTS ['\\*.sh'] 'Aa b \\ a\\ b' 2 3 4 5 6 8 9 11 PARTS ['Aa', 'b', ' a b'] '' PARTS [] 'a_b' 1 2 3 PARTS ['a', 'b'] ' a b ' 1 2 3 4 PARTS ['a', 'b'] 'a _ b' 1 4 5 PARTS ['a', 'b'] ' a _ b ' 2 3 6 7 PARTS ['a', 'b'] 'a _ _ b' 1 4 4 6 7 PARTS ['a', '', 'b'] 'a __ b' 1 3 3 5 6 PARTS ['a', '', 'b'] 'a _ _ _ b' 1 5 5 7 7 10 11 PARTS ['a', '', '', 'b'] ' a _ ' 2 3 5 PARTS ['a'] ' _ a _ ' 1 1 1 3 4 6 PARTS ['', 'a'] 'a\\ b' 1 2 4 PARTS ['a b'] 'a\\ b' 2 3 4 PARTS ['a\\', 'b'] '' PARTS [] '_' 0 0 1 PARTS [''] 'a_' 1 2 PARTS ['a'] '__a_b_' 0 0 1 1 2 3 4 5 6 PARTS ['', '', 'a', 'b'] 'a\\_b' 1 2 4 PARTS ['a_b'] 'a\\_b' 2 3 4 PARTS ['a\\', 'b'] [(, 4), (, 5), (, 8)] 'a__b---c_d' 1 2 2 3 4 5 5 6 6 7 8 9 10 PARTS ['a', '', 'b', '', '', 'c', 'd'] 'a\\_\\-b' 1 2 3 4 6 PARTS ['a_-b'] 'a\\_\\-b' 2 3 4 5 6 PARTS ['a\\', '\\', 'b'] '' PARTS [] '\t' 1 PARTS [] 'a\t' 1 PARTS ['a'] '\t\ta\tb\t' 2 3 4 5 PARTS ['a', 'b'] 'a\\\tb' 1 2 4 PARTS ['a\tb'] 'a\\\tb' 2 3 4 PARTS ['a\\', 'b'] core/lexer_gen_test.pyc . ---------------------------------------------------------------------- Ran 1 test in 0.064s OK --- a '"a" ' --- [a-z] '[a-z]' --- [a-zA-Z.]+ '[a-zA-Z.]+ ' --- [a-zA-Z_][a-zA-Z0-9_]*\+?= '[a-zA-Z_][a-zA-Z0-9_]* "+" ? "=" ' --- [."]* '[."]* ' --- \$ '"$" ' --- .* '.* ' --- '\x00' '"\\x00" ' --- \0 '"\\x00" ' --- \\ '"\\\\" ' --- [\\] '"\\\\" ' --- . '.' --- [^a] '[^a]' --- [^a-z] '[^a-z]' --- [a\.] '[a.]' --- [0-7]{1,3} '[0-7]{1,3} ' core/lexer_test.pyc ... ---------------------------------------------------------------------- Ran 3 tests in 0.002s OK 98 84 70 53 28 25 24 23 19 13 12 2 1 Number of lex states: 13 Number of token dispatches: 452 (token id:Lit_Chars val:abc span_id:None) (token id:Lit_LBrace val:'{' span_id:None) (token id:Op_Semi val:';' span_id:None) core/libstr_test.pyc ... ---------------------------------------------------------------------- Ran 3 tests in 0.008s OK ## shortest prefix 1 test 'a' return 'bcd' 2 test 'ab' return 'cd' 3 test 'abc' return 'd' 4 test 'abcd' return '' # longest prefix 4 test 'abcd' return '' 3 test 'abc' return 'd' 2 test 'ab' return 'cd' 1 test 'a' return 'bcd' % shortest suffix 3 test 'd' return 'abc' 2 test 'cd' return 'ab' 1 test 'bcd' return 'a' 0 test 'abcd' return '' %% longest suffix 0 test 'abcd' return '' 1 test 'bcd' return 'a' 2 test 'cd' return 'ab' 3 test 'd' return 'abc' Utf8Encode case 'e' 101 Utf8Encode case '\xc4\x80' 256 Utf8Encode case '\xe1\x88\xb4' 4660 Utf8Encode case '\xf0\xa0\x80\x80' 131072 Utf8Encode case '\xef\xbf\xbd' 268566528 core/process_test.pyc 1 _build 1 _devbuild 1 _tmp 1 asdl 1 benchmarks 1 bin 1 build 1 core 1 devtools 1 native 1 oil 1 opy 1 osh 1 pyc 2 so 1 spec 1 test 1 tools 3 txt 1 web pipe_status: [0, 0, 0, 0] .MD5 SIZES __init__ _build _devbuild _tmp asdl benchmarks bin build EEdate returned 0 date returned 0 Unexpected error in execvpe('does-not-exist', ['does-not-exist'], ...): [Errno 2] No such file or directory EEUnexpected error in execvpe('does-not-exist', ['does-not-exist'], ...): [Errno 2] No such file or directory EThu Aug 30 09:15:23 PDT 2018 date returned 0 F ====================================================================== ERROR: testPipeline2 (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb TypeError: list indices must be integers, not NoneType ====================================================================== ERROR: testProcess (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb SystemExit: 127 ====================================================================== FAIL: testStdinRedirect (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb AssertionError: 'one\n' != 'on' ---------------------------------------------------------------------- Ran 4 tests in 0.038s FAILED (failures=1, errors=2) . ====================================================================== ERROR: testPipeline2 (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb TypeError: list indices must be integers, not NoneType ====================================================================== ERROR: testProcess (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb SystemExit: 127 ---------------------------------------------------------------------- Ran 4 tests in 0.039s FAILED (errors=2) Unexpected error in execvpe('does-not-exist', ['does-not-exist'], ...): [Errno 2] No such file or directory E. ====================================================================== ERROR: testPipeline2 (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb TypeError: list indices must be integers, not NoneType ====================================================================== ERROR: testProcess (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb SystemExit: 127 ---------------------------------------------------------------------- Ran 4 tests in 0.045s FAILED (errors=2) BEFORE ['0', '1', '2', '3', '11'] AFTER ['0', '1', '2', '3', '11'] ------------------------------------------------------------ ls | cut -d . -f 1 | head [0, 0, 0] FDS BEFORE ['0', '1', '2', '3', '11'] ------------------------------------------------------------ date ------------------------------------------------------------ does-not-exist ... ====================================================================== ERROR: testPipeline2 (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb TypeError: list indices must be integers, not NoneType ---------------------------------------------------------------------- Ran 4 tests in 0.055s FAILED (errors=1) . ====================================================================== ERROR: testPipeline2 (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb TypeError: list indices must be integers, not NoneType ---------------------------------------------------------------------- Ran 4 tests in 0.058s FAILED (errors=1) .. ====================================================================== ERROR: testPipeline2 (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb TypeError: list indices must be integers, not NoneType ---------------------------------------------------------------------- Ran 4 tests in 0.063s FAILED (errors=1) BEFORE ['0', '1', '2', '3', '11'] AFTER ['0', '1', '2', '3', '11'] ------------------------------------------------------------ ls | cut -d . -f 1 | head [0, 0, 0] FDS BEFORE ['0', '1', '2', '3', '11'] ------------------------------------------------------------ date ------------------------------------------------------------ does-not-exist 1 FDS AFTER ['0', '1', '2', '3', '11'] .Thu Aug 30 09:15:23 PDT 2018 date returned 0 Unexpected error in execvpe('does-not-exist', ['does-not-exist'], ...): [Errno 2] No such file or directory E. ====================================================================== ERROR: testProcess (__main__.ProcessTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 121, in __call__ return self.im_func(self.im_self, *args, **kwargs) File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 102, in __call__ retval = self._vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb SystemExit: 127 ---------------------------------------------------------------------- Ran 4 tests in 0.089s FAILED (errors=1) BEFORE ['0', '1', '2', '3', '11'] AFTER ['0', '1', '2', '3', '11'] ------------------------------------------------------------ ls | cut -d . -f 1 | head [0, 0, 0] [1, 1, 1] FDS BEFORE ['0', '1', '2', '3', '11'] ------------------------------------------------------------ date ------------------------------------------------------------ does-not-exist .. ---------------------------------------------------------------------- Ran 4 tests in 0.104s OK BEFORE ['0', '1', '2', '3', '11'] AFTER ['0', '1', '2', '3', '11'] ------------------------------------------------------------ ls | cut -d . -f 1 | head [0, 0, 0] [1, 1, 1] FDS BEFORE ['0', '1', '2', '3', '11'] ------------------------------------------------------------ date ------------------------------------------------------------ does-not-exist 1 FDS AFTER ['0', '1', '2', '3', '11'] core/reader_test.pyc .. ---------------------------------------------------------------------- Ran 2 tests in 0.011s OK core/state_test.pyc ........ ---------------------------------------------------------------------- Ran 8 tests in 0.040s OK (Str s:/home/andy) (Undef) core/util_test.pyc . ---------------------------------------------------------------------- Ran 1 test in 0.000s OK core/word_compile_test.pyc ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK core/word_eval_test.pyc . ---------------------------------------------------------------------- Ran 1 test in 0.000s OK core/word_test.pyc . ---------------------------------------------------------------------- Ran 1 test in 0.000s OK osh/arith_parse_test.pyc . ) ( () ( 1 (1 + (3 * 4) (1 + (3 * 4) 5 ; - ; expression: (7) node: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:7 span_id:1))])) expression: 1 + 2 - 3 node: (ArithBinary op_id: Arith_Minus left: (ArithBinary op_id: Arith_Plus left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:1 span_id:0))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:4))]) ) ) right: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:8))])) ) expression: 1 + 2 * 3 node: (ArithBinary op_id: Arith_Plus left: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:1 span_id:0))])) right: (ArithBinary op_id: Arith_Star left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:4))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:8))]) ) ) ) expression: 7 - 9 * (2 - 3) node: (ArithBinary op_id: Arith_Minus left: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:7 span_id:0))])) right: (ArithBinary op_id: Arith_Star left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:9 span_id:4))]) ) right: (ArithBinary op_id: Arith_Minus left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:9))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:13))]) ) ) ) ) expression: 2 * 3 * 4 node: (ArithBinary op_id: Arith_Star left: (ArithBinary op_id: Arith_Star left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:0))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:4))]) ) ) right: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:8))])) ) expression: 2 ** 3 ** 4 node: (ArithBinary op_id: Arith_DStar left: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:0))])) right: (ArithBinary op_id: Arith_DStar left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:4))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:8))]) ) ) ) expression: (2 ** 3) ** 4 node: (ArithBinary op_id: Arith_DStar left: (ArithBinary op_id: Arith_DStar left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:1))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:5))]) ) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:10))]) ) ) expression: 5 node: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:5 span_id:0))])) expression: 4 + 2 node: (ArithBinary op_id: Arith_Plus left: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:0))])) right: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:4))])) ) expression: 9 - 8 - 7 node: (ArithBinary op_id: Arith_Minus left: (ArithBinary op_id: Arith_Minus left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:9 span_id:0))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:8 span_id:4))]) ) ) right: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:7 span_id:8))])) ) expression: 9 - (8 - 7) node: (ArithBinary op_id: Arith_Minus left: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:9 span_id:0))])) right: (ArithBinary op_id: Arith_Minus left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:8 span_id:5))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:7 span_id:9))]) ) ) ) expression: (9 - 8) - 7 node: (ArithBinary op_id: Arith_Minus left: (ArithBinary op_id: Arith_Minus left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:9 span_id:1))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:8 span_id:5))]) ) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:7 span_id:10))]) ) ) expression: 2 + 3 ** 2 * 3 + 4 node: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Plus left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:0))]) ) right: (ArithBinary op_id: Arith_Star left: (ArithBinary op_id: Arith_DStar left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:4))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:8))]) ) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:12))]) ) ) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:16))]) ) ) expression: 4 * 3 / 2 node: (ArithBinary op_id: Arith_Slash left: (ArithBinary op_id: Arith_Star left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:0))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:4))]) ) ) right: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:8))])) ) expression: 3 * 2 % 4 node: (ArithBinary op_id: Arith_Percent left: (ArithBinary op._id: Arith_Star left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:0))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:4))]) ) ) right: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:8))])) ) expression: + 1 node: (ArithUnary op_id: Node_UnaryPlus child: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:1 span_id:2))])) ) expression: - 5 node: (ArithUnary op_id: Node_UnaryMinus child: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:5 span_id:2))])) ) expression: -2-3 node: (ArithBinary op_id: Arith_Minus left: (ArithUnary op_id: Node_UnaryMinus child: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:1))]) ) ) right: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:3))])) ) expression: 1 ? 2 : 3, 4 ? 5 : 6 node: (ArithBinary op_id: Arith_Comma left: (TernaryOp cond: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:1 span_id:0))]) ) true_expr: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:4))]) ) false_expr: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:8))]) ) ) right: (TernaryOp cond: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:11))]) ) true_expr: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:5 span_id:15))]) ) false_expr: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:6 span_id:19))]) ) ) ) expression: 1 , 2, 3 node: (ArithBinary op_id: Arith_Comma left: (ArithBinary op_id: Arith_Comma left: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:1 span_id:0))]) ) right: (ArithWord w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:4))]) ) ) right: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:7))])) ) expression: 011 node: (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:011 span_id:0))])) expression: 0xA node: (ArithWord w: (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Digits val:0 span_id:0)) (LiteralPart token:(token id:Lit_ArithVarLike val:xA span_id:1)) ] ) ) expression: 64#z node: (ArithWord w: (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Digits val:64 span_id:0)) (LiteralPart token:(token id:Lit_Pound val:'#' span_id:1)) (LiteralPart token:(token id:Lit_ArithVarLike val:z span_id:2)) ] ) ) expression: 64#Z node: (ArithWord w: (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Digits val:64 span_id:0)) (LiteralPart token:(token id:Lit_Pound val:'#' span_id:1)) (LiteralPart token:(token id:Lit_ArithVarLike val:Z span_id:2)) ] ) ) expression: 64#@ node: (ArithWord w: (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Digits val:64 span_id:0)) (LiteralPart token:(token id:Lit_Pound val:'#' span_id:1)) (LiteralPart token:(token id:Lit_At val:'@' span_id:2)) ] ) ) expression: 64#_ node: (ArithWord w: (CompoundWord parts: [ (LiteralPart token:(token id:Lit_Digits val:64 span_id:0)) (LiteralPart token:(token id:Lit_Pound val:'#' span_id:1)) (LiteralPart token:(token id:Lit_ArithVarLike val:_ span_id:2)) . ---------------------------------------------------------------------- Ran 3 tests in 0.595s OK ] ) ) osh/bool_parse_test.pyc ...... ---------------------------------------------------------------------- Ran 6 tests in 0.243s OK (LogicalOr left: (WordTest w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:0))])) right: (LogicalNot child: (WordTest w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:bar span_id:6))]) ) ) ) (BoolBinary op_id: BoolBinary_GlobDEqual left: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:0))]) right: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:4))]) ) (WordTest w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:0))])) (WordTest w: (CompoundWord parts: [ (SimpleVarSub token:(token id:VSub_Name val:'$foo' span_id:0)) (DoubleQuotedPart parts: [(LiteralPart token:(token id:Lit_Chars val:bar span_id:2))] spids: [1 3] ) ] ) ) ------------- (BoolUnary op_id: BoolUnary_z child: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:2))]) ) (BoolBinary op_id: BoolBinary_GlobDEqual left: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:0))]) right: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:bar span_id:4))]) ) (BoolBinary op_id: BoolBinary_GlobDEqual left: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:2))]) right: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:bar span_id:6))]) ) (WordTest w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:0))])) (LogicalNot child: (WordTest w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:2))])) ) (LogicalAnd left: (WordTest w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:zoo span_id:0))])) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:6))]) right: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:bar span_id:10))]) ) ) (LogicalAnd left: (WordTest w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:0))])) right: (LogicalNot child: (WordTest w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:bar span_id:6))]) ) ) ) (LogicalAnd left: (WordTest w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:0))])) right: (LogicalAnd left: (LogicalNot child: (WordTest w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:bar span_id:6))]) ) ) right: (WordTest w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:baz span_id:10))]) ) ) ) (LogicalAnd left: (BoolUnary op_id: BoolUnary_z child: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:2))]) ) right: (BoolUnary op_id: BoolUnary_z child: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:bar span_id:8))]) ) ) osh/cmd_parse_test.pyc ....(CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:empty) op:Equal rhs:{(ArrayLiteralPart)} spids:[0])] spids: [0] ) ] ) (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:array) op: Equal rhs: {(ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} spids: [0] ) ] spids: [0] ) ] ) Line 2 of '' ls array=(a b c) ^~~~~~ Commands can't contain array literals Line 2 of '' array=(a b c) ls ^ Environment bindings can't contain array literals (CommandList children: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:array) op: Equal rhs: {(ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} spids: [0] ) ] spids: [0] ) terminator: ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:array2) op: Equal rhs: {(ArrayLiteralPart words:[{(d)} {(e)} {(f)}])} spids: [10] ) ] spids: [10] ) ] ) (C {(ls)} {(foo)}) (Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (AndOr ops:[Op_DPipe] children:[(C {(ls)} {(foo)}) (C {(die)})]) (AndOr ops: [Op_DPipe] children: [(Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)})] ) (CommandList children:[(Case to_match:{(foo)} spids:[0 4 6])]) (CommandList children: [ (Case to_match: {(word)} arms: [ (case_arm pat_list: [{(foo)} {(foo2)} {(foo3)}] action: [(C {(echo)} {(hi)})] spids: [7 12 18 16777215] ) ] spids: [0 4 20] ) ] ) (CommandList children: [ (Case to_match: {(word)} arms: [(case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(one-line)})] spids:[6 7 13 16777215])] spids: [0 4 15] ) ] ) (CommandList children: [ (Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})] spids:[7 8 14 16777215]) (case_arm pat_list:[{(bar)}] action:[(C {(echo)} {(bar)})] spids:[17 18 24 16777215]) ] spids: [0 4 26] ) ] ) (CommandList children: [ (Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})] spids:[7 8 14 16777215]) (case_arm pat_list: [{(bar)}] action: [(Sentence child:(C {(echo)} {(bar)}) terminator:)] spids: [20 21 16777215 29] ) ] spids: [0 4 29] ) ] ) (CommandList children: [ (Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})] spids:[7 8 14 16777215]) (case_arm pat_list:[{(bar)}] action:[(C {(echo)} {(bar)})] spids:[20 21 16777215 27]) ] spids: [0 4 27] ) ] ) (SimpleCommand words: [ (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:ls span_id:0))]) (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:foo span_id:2))]) ] ) (FuncDef name: func body: (BraceGroup children: [ (Sentence child: (SimpleCommand words: [ (CompoundWord parts: [(LiteralPart token:(token id:Lit_Chars val:echo span_id:6))] ) (CompoundWord parts: [(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] ) (CommandList children: [ (SimpleCommand words: [{(ls)} {(foo)}] redirects: [(Redir op:'> fd:2 arg_word:{(/dev/null)})] ....... ) ] ) (CommandList children:[(Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F)]) (CommandList children: [ (AndOr ops: [Op_DPipe] children: [(Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)})] ) ] ) (CommandList children: [ (Sentence child: (AndOr ops: [Op_DPipe] children: [(Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)})] ) terminator: ) (C {(ls)} {(/)}) ] ) (CommandList children:[(C {(ls)} {(foo)})]) (CommandList children: [ (Sentence child: (AndOr ops: [Op_DPipe] children: [(Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)})] ) terminator: ) (C {(ls)} {(/)}) ] ) (CommandList children: [ (Sentence child: (AndOr ops: [Op_DPipe] children: [ (Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(echo)} {(fail)}) ] ) terminator: ) (AndOr ops: [Op_DPipe] children: [ (Pipeline children:[(C {(echo)} {(bar)}) (C {(wc)} {(-c)})] negated:F) (C {(echo)} {(f2)}) ] ) ] ) (C {(echo)} { (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(12)})]) left_token: spids: [2 6] ) (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(34)})]) left_token: spids: [7 11] ) } ) (C {(echo)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(12)})]) left_token: spids: [3 7] ) (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(34)})]) left_token: spids: [8 12] ) ) } ) (CommandList children: [(DBracket expr:(BoolBinary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}))] ) (CommandList children: [ (DBracket expr: (LogicalAnd left: (BoolBinary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}) right: (WordTest w:{(foo)}) ) ) ] ) (CommandList children: [ (If arms: [ (if_arm cond: [(DBracket expr:(BoolBinary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}))] action: [(C {(echo)} {(hi)})] spids: [16777215 12] ) ] spids: [16777215 19] ) ] ) (CommandList children: [(DBracket expr:(BoolBinary op_id:BoolBinary_EqualTilde left:{(foo)} right:{(foo)}))] ) (CommandList children: [ (DBracket expr: (BoolBinary op_id:BoolBinary_EqualTilde left:{(foo)} right:{('(') (foo) ('|') (bar) (')')}) ) ] ) (CommandList children: [ (DParen child: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 1)}) right: (ArithWord w:{(Lit_Digits 2)}) ) spids: [0 9] ) ] ) (CommandList children: [ (ForEach iter_name: i iter_words: [{(1)} {(2)} {(3)}] do_arg_iter: F body: (DoGroup children:[(C {(echo)} {($ VSub_Name '$i')})] spids:[13 20]) spids: [5 11] ) ] ) (CommandList children: [ (ForEach iter_name: i do_arg_iter: F body: (DoGroup children:[(C {(echo)} {($ VSub_Name '$i')})] spids:[8 15]) spids: [5 6] ) ] ) (CommandList children: [ (ForEach iter_name: i do_arg_iter: T body: (DoGroup children: [(Sentence child:(C {(echo)} {($ VSub_Name '$i')}) terminator:)] spids: [5 12] ) spids: [16777215 16777215] ) ] ) (CommandList children: [ (ForEach iter_name: i do_arg_iter: T body: (DoGroup children:[(C {(echo)} {($ VSub_Name '$i')})] spids:[4 11]) spids: [16777215 16777215] ) ] ) (Command..List children: [ (ForExpr init: (BinaryAssign op_id:Arith_Equal left:(LhsName name:i) right:(ArithWord w:{(Lit_Digits 0)})) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w:{(Lit_Digits 5)}) ) update: (UnaryAssign op_id:Arith_DPlus child:(LhsName name:i)) body: (DoGroup children:[(C {(echo)} {($ VSub_Name '$i')})] spids:[19 26]) ) ] ) (CommandList children: [ (ForExpr init: (BinaryAssign op_id:Arith_Equal left:(LhsName name:i) right:(ArithWord w:{(Lit_Digits 0)})) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w:{(Lit_Digits 5)}) ) update: (UnaryAssign op_id:Arith_DPlus child:(LhsName name:i)) body: (DoGroup children:[(C {(echo)} {($ VSub_Name '$i')})] spids:[18 25]) ) ] ) (CommandList children: [(ForExpr body:(DoGroup children:[(C {(echo)} {($ VSub_Name '$i')})] spids:[9 16]))] ) (CommandList children: [ (FuncDef name: foo body: (BraceGroup children: [(Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [4] ) spids: [0 3] ) ] ) (CommandList children: [(FuncDef name:foo body:(Subshell child:(C {(echo)} {(hi)}) spids:[4 10]) spids:[0 3])] ) (CommandList children: [ (FuncDef name: foo body: (ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (DoGroup children: [(Sentence child:(C {(echo)} {($ VSub_Name '$i')}) terminator:)] spids: [13 20] ) spids: [9 11] ) spids: [0 3] ) ] ) (CommandList children: [ (FuncDef name: foo body: (BraceGroup children: [(Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [4] ) spids: [0 3] ) ] ) (CommandList children: [ (FuncDef name: foo body: (BraceGroup children: [(Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [7] ) spids: [0 6] ) ] ) (CommandList children: [(FuncDef name:foo body:(Subshell child:(C {(echo)} {(hi)}) spids:[6 12]) spids:[0 5])] ) (CommandList children: [ (FuncDef name: foo body: (ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (DoGroup children: [(Sentence child:(C {(echo)} {($ VSub_Name '$i')}) terminator:)] spids: [15 22] ) spids: [11 13] ) spids: [0 5] ) ] ) (CommandList children: [ (FuncDef name: foo body: (ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (DoGroup children: [(Sentence child:(C {(echo)} {($ VSub_Name '$i')}) terminator:)] spids: [13 20] ) spids: [9 11] ) spids: [0 3] ) ] ) (CommandList children: [ (FuncDef name: foo body: (BraceGroup children: [(Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [4] ) redirects: [ (Redir op:&'> fd:1 arg_word:{(2)}) (Redir op:'> fd:2 arg_word:{(/dev/null)}) ] spids: [0 3] ) ] ) (CommandList children: [ (If arms: [ (if_arm cond: [(Sentence child:(C {(true)}) terminator:)] action: [(Sentence child:(C {(echo)} {(yes)}) terminator:)] spids: [16777215 5] ) ] spids: [16777215 12] ) ] ) (CommandList children: [ (If arms: [ (if_arm cond: [(Sentence child:(Subshell child:(C {(true)}) spids:[2 4]) terminator:)] action: [(Sentence .........Error compiling regex: Un-matched parenthesis group operators. ..child:(C {(echo)} {(yes)}) terminator:)] spids: [16777215 7] ) ] spids: [16777215 14] ) ] ) (CommandList children:[(C {(ifFOO)})]) (C {(ls)} {(foo)}) (Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (Pipeline children:[(C {(echo)} {(foo)}) (C {(grep)} {(foo)})] negated:T) (Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)}) (C {(less)})] negated:F) Line 2 of '' ls foo| ^ Unexpected EOF while parsing command (CommandList children: [(Pipeline children:[(C {(ls)}) (C {(cat)}) (C {(cat)})] negated:F stderr_indices:[1])] ) (CommandList children: [(Pipeline children:[(C {(ls)}) (C {(cat)}) (C {(cat)})] negated:F stderr_indices:[0])] ) (CommandList children: [(Pipeline children:[(C {(ls)}) (C {(cat)}) (C {(cat)})] negated:F stderr_indices:[0 1])] ) (CommandList children: [ (C {(ls)} {(TildeSubPart token:)} {(TildeSubPart token:)} {(TildeSubPart token:) (/src)} {(TildeSubPart token:) (/src/foo)} {(TildeSubPart token:) (/src)} {(Lit_TildeLike '~weird') (KW_Bang '!') (name/blah) (KW_Bang '!') (blah)} ) ] ) (CommandList children: [ (Until cond: [(Sentence child:(C {(false)}) terminator:)] body: (DoGroup children: [(C {(echo)} {(hi)}) (ControlFlow token:)] spids: [5 15] ) ) ] ) (CommandList children: [ (While cond: [(Sentence child:(C {(true)}) terminator:)] body: (DoGroup children: [(C {(echo)} {(hi)}) (ControlFlow token:)] spids: [5 15] ) ) ] ) (CommandList children: [ (While cond: [(C {(true)})] body: (DoGroup children: [(C {(echo)} {(hi)}) (ControlFlow token:)] spids: [7 26] ) ) ] ) Line 2 of '' (( 1 + )) ^ Token can't be used in prefix position Line 2 of '' A= (1 2) ^ Expected ( after =, got ' ' Line 2 of '' [[ foo bar ]] ^~~ Expected ]] Line 2 of '' [[ foo -eq ]] ^ Expected ]] Line 2 of '' [[ foo$(echo <) -eq foo ]] ^ Invalid token after redirect operator Line 2 of '' [[ foo =~ \( ]] ^~ Invalid regex: '(' Line 2 of '' ls < ^ Invalid token after redirect operator Line 2 of '' ls < < ^ Invalid token after redirect operator Line 2 of '' echo foo$(ls <)bar ^ Invalid token after redirect operator Line 2 of '' BAD_ENV=(1 2 3) ls ^ Environment bindings can't contain array literals Line 2 of '' ls BAD_ENV=(1 2 3) ^~~~~~~~ Commands can't contain array literals Line 2 of '' ENV1=A ENV2=B local foo=bar ^ Assignments shouldn't have environment bindings Line 2 of '' for ((i=1; i<)); do echo $i; done ^ Token can't be used in prefix position Line 2 of '' for ((i=1; i<5; ++i)) OOPS echo $i; ERR ^~~~ Invalid word after for expression Line 2 of '' for ((i=1; i<5; ++i)); OOPS echo $i; ERR ^~~~ Expected word type KW_Do Line 2 of '' for $bad in 1 2; do echo hi; done ^~~~ Loop variable name should be a constant Line 2 of '' for foo BAD ^~~ Unexpected word after for loop variable Line 2 of '' if foo; then echo hi; z ^ Expected word type KW_Fi Line 2 of '' foo$(invalid) () { echo hi; } ^~~ Invalid function name Line 2 of '' foo="" echo "bar ^ Unexpected EOF reading double-quoted string that be..........gan here Line 2 of '' for x in 1 2 $( ^ Invalid word in for loop Line 2 of '' for ( i = 1; i < 10; i++ ) ^ Loop variable name should be a constant Line 2 of '' for = in a ^ Invalid loop variable name Line 2 of '' for x in 1 2 $(cat <' foo"bar" () { ^~~ Invalid function name Line 2 of '' x=1 >/dev/null ^~ Global assignment shouldn't have redirects Line 2 of '' echo hi; x=1 >/dev/null ^~ Global assignment shouldn't have redirects Line 2 of '' declare x=1 >/dev/null ^~~~~~~ Assignments shouldn't have redirects (CommandList children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 17 stdin_parts: [ ('1 ') (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(2)}) (C {(echo)} {(3)})]) left_token: spids: [6 14] ) (' 4\n') ] ) ] ) ] ) (CommandList children: [ (AndOr ops: [Op_DPipe] children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(echo)} {(hi)}) ] ) ] ) (CommandList children: [ (AndOr ops: [Op_DAmp] children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 14 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(echo)} {(hi)}) ] ) ] ) (CommandList children: [ (AndOr ops: [Op_DAmp] children: [ (SimpleCommand words: [{(tac)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF1)} here_end_span_id: 15 stdin_parts: [('PIPE A1\n') ('PIPE A2\n')] ) ] ) (SimpleCommand words: [{(tac)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF2)} here_end_span_id: 19 stdin_parts: [('PIPE B1\n') ('PIPE B2\n')] ) ] ) ] ) ] ) (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 12 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(tac)}) ] negated: F ) ] ) (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(tac)}) ] negated: F ) ] ) (CommandList children: [ (Sentence child: (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 ...... here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) terminator: ) (C {(echo)} {(hi)}) ] ) (CommandList children: [ (Sentence child: (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 14 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) terminator: ) (C {(echo)} {(hi)}) ] ) (CommandList children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('one tab then foo: ') ($ VSub_Name '$foo') ('\n')] ) ] ) ] ) (CommandList children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(DQ (EOF))} here_end_span_id: 9 stdin_parts: [('$v\n') ('"two\n')] ) ] ) ] ) (CommandList children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(SQ )} here_end_span_id: 8 stdin_parts: [('single-quoted: $var\n')] ) ] ) ] ) (CommandList children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EO) (EscapedLiteralPart token:)} here_end_span_id: 8 stdin_parts: [('single-quoted: $var\n')] ) ] ) ] ) (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF1)} here_end_span_id: 15 stdin_parts: [('PIPE A1\n') ('PIPE A2\n')] ) ] ) (SimpleCommand words: [{(tac)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF2)} here_end_span_id: 19 stdin_parts: [('PIPE B1\n') ('PIPE B2\n')] ) ] ) ] negated: F ) ] ) (CommandList children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [($ VSub_Name '$v') ('\n') (Right_DoubleQuote '"') ('two\n')] ) ] ) ] ) (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (C {(echo)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{(Lit_Digits 1)}) right: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 2)}) right: (ArithWord w:{(Lit_Digits 3)}) ) ) spids: [5 14] ) } ) ] ) left_token: spids: [2 16] ) } ) (CommandList children: [ (Subshell child: (C {(echo)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{(Lit_Digits 1)}) .... right: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 2)}) right: (ArithWord w:{(Lit_Digits 3)}) ) ) spids: [3 12] ) } ) spids: [0 14] ) ] ) (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (C {(echo)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 1)}) right: (ArithWord w:{(Lit_Digits 2)}) ) spids: [5 10] ) } ) ] ) left_token: spids: [2 11] ) } ) (CommandList children: [ (Subshell child: (C {(echo)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 1)}) right: (ArithWord w:{(Lit_Digits 2)}) ) spids: [3 8] ) } ) spids: [0 9] ) ] ) (CommandList children: [ (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:array) op: Equal rhs: {(ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} spids: [3] ) ] spids: [3] ) ] ) left_token: spids: [2 11] ) } ) ] ) (CommandList children: [ (Subshell child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:array) op: Equal rhs: {(ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} spids: [1] ) ] spids: [1] ) spids: [0 9] ) ] ) (CommandList children: [ (C { (CommandSubPart command_list: (CommandList children: [ (Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(hi)})] spids: [9 11 17 16777215] ) ] spids: [2 6 20] ) ] ) left_token: spids: [0 22] ) } ) ] ) (CommandList children: [ (Subshell child: (Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(echo)} {(hi)})] spids:[9 11 17 16777215])] spids: [2 6 20] ) spids: [0 22] ) ] ) (CommandList children: [ (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(comsub)})] spids: [10 11 16 16777215] ) ] spids: [4 8 18] ) ] ) left_token: spids: [2 19] ) } ) ] ) (CommandList children: [ (C {(echo)} { (CommandSubPart command_list: (CommandList chil....dren: [ (Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(comsub1)})] spids: [10 11 16 16777215] ) ] spids: [4 8 18] ) (Case to_match: {(bar)} arms: [ (case_arm pat_list: [{(two)}] action: [(C {(echo)} {(comsub2)})] spids: [26 27 32 16777215] ) ] spids: [20 24 34] ) ] ) left_token: spids: [2 36] ) } ) ] ) (C {(echo)} { (DQ ('double ') (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(hi)})]) left_token: spids: [4 8] ) (' quoted') ) } {(two)} ) (CommandList children: [ (Sentence child:(C {(echo)} {(one)}) terminator:) (Sentence child: (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (Case to_match: {(one)} arms: [ (case_arm pat_list: [ { (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(one)})]) left_token: spids: [15 19] ) } ] action: [ (C {(echo)} { (CommandSubPart command_list: (CommandList children:[(C {(comsub)})]) left_token: spids: [24 26] ) } ) ] spids: [15 20 27 16777215] ) ] spids: [9 13 29] ) ] ) left_token: spids: [7 31] ) } ) terminator: ) (C {(echo)} {(two)}) ] ) (CommandList children:[(Subshell child:(Case to_match:{(foo)} spids:[2 6 9]) spids:[0 11])]) (CommandList children: [ (C { (CommandSubPart command_list: (CommandList children: [ (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{(Lit_Digits 0)}) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w:{(Lit_Digits 3)}) ) update: (UnaryAssign op_id:Arith_DPlus child:(LhsName name:i)) body: (DoGroup children:[(C {(echo)} {(hi)})] spids:[21 29]) ) ] ) left_token: spids: [0 31] ) } ) ] ) (CommandList children: [ (Subshell child: (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{(Lit_Digits 0)}) ) cond: (ArithBinary o......p_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w:{(Lit_Digits 3)}) ) update: (UnaryAssign op_id:Arith_DPlus child:(LhsName name:i)) body: (DoGroup children:[(C {(echo)} {(hi)})] spids:[21 29]) ) spids: [0 31] ) ] ) (CommandList children: [ (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (Sentence child: (FuncDef name: func body: (BraceGroup children: [(Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [7] ) spids: [3 6] ) terminator: ) (C {(func)}) ] ) left_token: spids: [2 18] ) } ) ] ) (CommandList children: [ (Subshell child: (CommandList children: [ (Sentence child: (FuncDef name: func body: (BraceGroup children: [(Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [5] ) spids: [1 4] ) terminator: ) (C {(func)}) ] ) spids: [0 16] ) ] ) (C {(echo)} { (ArithSubPart anode: (BinaryAssign op_id: Arith_Equal left: (LhsIndexedName name: a index: (ArithBinary op_id: Arith_Star left: (ArithWord w:{(Lit_Digits 1)}) right: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 2)}) right: (ArithWord w:{(Lit_Digits 3)}) ) ) ) right: (ArithVarRef name:x) ) spids: [2 16] ) } ) (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (C {(one) (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(two)})]) left_token: spids: [4 8] ) (one) } ) ] ) left_token: spids: [2 10] ) } {(three)} ) (CommandList children: [ (BraceGroup children: [ (Sentence child:(C {(cd)} {(/)}) terminator:) (Sentence child:(C {(echo)} {(PWD)}) terminator:) ] spids: [0] ) ] ) (CommandList children: [ (Sentence child: (BraceGroup children: [ (Sentence child:(C {(cd)} {(/)}) terminator:) (Sentence child:(C {(echo)} {(PWD)}) terminator:) ] spids: [0] ) terminator: ) (C {(echo)} {(PWD)}) ] ) (CommandList children: [ (Sentence child: (Subshell child: (CommandList children: [ (Sentence child:(C {(cd)} {(/)}) terminator:) (C {(echo)} {(PWD)} {(1)}) ] ) spids: [0 11] ) terminator: ) (C {(echo)} {(PWD)} {(2)}) ] ) (CommandList children: [ (Sentence child:(C {(echo)} {(one)}) terminator:) (Sentence child: (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ ...... (Sentence child: (Subshell child: (CommandList children: [ (Sentence child: (C {(cd)} {(/)}) terminator: ) (C {(echo)} {(subshell_PWD)}) ] ) spids: [9 18] ) terminator: ) (C {(echo)} {(comsub_PWD)}) ] ) left_token: spids: [7 24] ) } ) terminator: ) (C {(echo)} {(two)}) ] ) (CommandList children: [ (C { (CommandSubPart command_list: (CommandList children: [ (Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(hi)})] spids: [9 10 16 16777215] ) ] spids: [2 6 19] ) ] ) left_token: spids: [0 21] ) } ) ] ) (CommandList children: [ (Subshell child: (Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] action:[(C {(echo)} {(hi)})] spids:[9 10 16 16777215])] spids: [2 6 19] ) spids: [0 21] ) ] ) (C {(echo)} {(ab) (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(hi)})]) left_token: spids: [3 7] ) (cd) } {(ef)} ) (CommandList children: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: bracket_op: (ArrayIndex expr: (ArithWord w: {(${ VSub_Name tag_marker) (Lit_Digits 002) (${ VSub_Name cons_ptr)} ) ) spids: [7 18] ) ) } ) ) terminator: ) ] ) (CommandList children: [ (C {(echo)} { (ArithSubPart anode: (ArithWord w:{(Lit_Digits 0) (Lit_ArithVarLike x) ($ VSub_Name '$foo')}) spids: [3 10] ) } ) ] ) Line 2 of '' errcmd=( "${SETUP_STATE[$err.cmd]}" ) ^ Unexpected token in arithmetic context (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:errcmd) op: Equal rhs: { (ArrayLiteralPart words: [ { (DQ (BracedVarSub token: bracket_op: (ArrayIndex expr:(ArithWord w:{(DQ ($ VSub_Name '$err') (.cmd))})) spids: [5 13] ) ) } ] ) } spids: [1] ) ] spids: [1] ) ] ) (CommandList children: [ (C {(echo)} {(CommandSubPart command_list:(NoOp) left_token: spids:[2 3])}) ] ) (CommandList children: [ (C {(echo)} {(CommandSubPart command_list:(NoOp) left_token: spids:[2 3])}) ] ) (Comma....ndList children: [ (C {(cmd)} {(flag)} {(CommandSubPart command_list:(NoOp) left_token: spids:[4 8])} ) ] ) (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:FOO) op: Equal rhs: {(DQ (bar)) (CommandSubPart command_list: (NoOp) left_token: spids: [4 7] ) (DQ (baz)) } spids: [0] ) ] spids: [0] ) ] ) (CommandList children: [ (If arms: [ (if_arm cond: [(Sentence child:(C {(true)}) terminator:)] action: [(Subshell child:(C {(echo)} {(hi)}) spids:[7 14])] spids: [16777215 5] ) ] spids: [16777215 16] ) ] ) (CommandList children: [ (While cond: [(Sentence child:(C {(true)}) terminator:)] body: (DoGroup children: [ (BraceGroup children: [(C {(echo)} {(hi)}) (ControlFlow token:)] spids: [7] ) ] spids: [5 19] ) ) ] ) (CommandList children: [ (If arms: [ (if_arm cond: [(Sentence child:(C {(true)}) terminator:)] action: [(Subshell child:(C {(echo)} {(hi)}) spids:[7 14])] spids: [16777215 5] ) ] spids: [16777215 16] ) ] ) (CommandList children: [ (If arms: [ (if_arm cond: [(Sentence child:(C {(true)}) terminator:)] action: [ (If arms: [ (if_arm cond: [(Sentence child:(C {(true)}) terminator:)] action: [(C {(echo)} {(hi)})] spids: [16777215 13] ) ] spids: [16777215 21] ) ] spids: [16777215 5] ) ] spids: [16777215 23] ) (C {(echo)} {(hi)}) ] ) (CommandList children: [ (Subshell child: (AndOr ops: [Op_DAmp] children: [ (C {(cd)} {(DQ ($ VSub_Name '$PACKDIR'))}) (ForEach iter_name: e iter_words: [{($ VSub_Name '$existing')}] do_arg_iter: F body: (DoGroup children: [ (Case to_match: {(DQ (' ') ($ VSub_Name '$fullbases') (' '))} arms: [ (case_arm pat_list: [ {(Lit_Other '*') (DQ (' ') ($ VSub_Name '$e') (' ')) (Lit_Other '*')} ] spids: [34 41 43 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name '$e') (.pack))} {(DQ ($ VSub_Name '$e') (.idx))} {(DQ ($ VSub_Name '$e') (.keep))} ) ] spids: [46 47 68 16777215] ) ] spids: [23 31 71] ) ] spids: [20 74] ) spids: [16 16777215] ) ] ) spids: [0 76] ) ] ) (CommandList children: [ (Sentence child: (C {(.)} {(DQ ($ VSub_Name '$TEST_DIRECTORY')) (/diff-lib.sh)}) terminator: ) ] ) (CommandList children:[(C {(echo)} {(foo) (Lit_Pound '#') (bar)})]) (CommandList children:[(C {(echo)} {(foo)})]) (CommandList children:[(C {(echo)} {(foo)})]) (CommandList children: [ (Case to_match: {(DQ ($ VSub_Name '$fd') (',') ($ VSub_Name '$command'))} arms: [ ................. (case_arm pat_list: [{(3) (Lit_Comma ',') (Lit_Pound '#') (Lit_Other '*')} {(3) (Lit_Comma ',')}] spids: [11 18 25 16777215] ) ] spids: [0 8 27] ) ] ) (CommandList children: [ (Case to_match: {(foo)} arms: [ (case_arm pat_list: [ { (SingleQuotedPart left: tokens: [] spids: [7 9] ) } ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: PlusEqual rhs: {(DQ (EscapedLiteralPart token:)) (EscapedLiteralPart token:) } spids: [13] ) ] spids: [13] ) ] spids: [7 10 20 16777215] ) ] spids: [1 5 22] ) ] ) (CommandList children: [ (C { (SingleQuotedPart left: tokens: [ ] spids: [1 5] ) } ) ] ) (SimpleCommand words: [{(echo)} {(hi)}] redirects: [(Redir op:|'> fd:16777215 arg_word:{(clobbered.txt)})] ) (Redir op:&'> fd:1 arg_word:{(2)}) (HereDoc op: fd:16777215 here_begin:{(EOF)} here_end_span_id:None) (HereDoc op: fd:16777215 here_begin:{(EOF)} here_end_span_id:None) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('hi\n')] ) (Redir op:'> fd:16777215 arg_word:{(out.txt)}) ] ) (Redir op:'> fd:16777215 arg_word:{(out.txt)}) (HereDoc op: fd:16777215 here_begin:{(EOF)} here_end_span_id:None) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op:'> fd:16777215 arg_word:{(out.txt)}) (Redir op:&'> fd:1 arg_word:{(2)}) ] ) (SimpleCommand words: [{(cat)}] redirects: [(Redir op: fd:16777215 arg_word:{(3)})] ) (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs:(LhsName name:ONE) op:Equal rhs:{(1)} spids:[0]) (assign_pair lhs:(LhsName name:TWO) op:Equal rhs:{(2)} spids:[3]) ] spids: [0] ) ] ) (CommandList children: [ (SimpleCommand redirects:[(Redir op:'> fd:16777215 arg_word:{(out.txt)})]) ] ) (C {(echo)} {(DQ (one)) (two)} {(DQ (three)) (DQ (four))} {(five)}) (CommandList children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs:(LhsName name:foo) op:Equal rhs:{(bar)} spids:[2]) (assign_pair lhs:(LhsName name:spam) op:Equal spids:[5]) (assign_pair lhs:(LhsName name:eggs) op:Equal spids:[7]) (assign_pair lhs:(LhsName name:one) op:Equal rhs:{(1)} spids:[9]) ] spids: [0] ) ] ) (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:foo) op:Equal rhs:{(bar)} spids:[0])] spids: [0] ) ] ) Line 2 of '' FOO=bar local foo=$(env) ^~~ Assignments shouldn't have environment bindings (CommandList children: [ (SimpleCommand words: [{(env)}] redirects: [(Redir op:'> fd:16777215 arg_word:{(out.txt)})] more_env: [(env_pair name:PYTHONPATH val:{(.)} spids:[3])] ) ] ) (CommandList children: [ (SimpleCommand words: [{(echo)} {(1)} {(2)} {(3)}] redirects: [(Redir op:'> fd:16777215 arg_word:{(out.txt)})] ) ] ) (C {(ls)} {(foo)}) (SimpleCommand words:[{(ls)} {(foo)}] more_en.. ---------------------------------------------------------------------- Ran 83 tests in 27.348s OK v:[(env_pair name:FOO val:{(bar)} spids:[0])]) (SimpleCommand words: [{(ls)} {(foo)}] redirects: [(Redir op:'> fd:16777215 arg_word:{(output.txt)})] more_env: [(env_pair name:FOO val:{(bar)} spids:[0]) (env_pair name:SPAM val:{(eggs)} spids:[6])] ) (SimpleCommand words: [{(ls)} {(foo)}] redirects: [ (Redir op:'> fd:16777215 arg_word:{(output.txt)}) (Redir op:'> fd:16777215 arg_word:{(output2.txt)}) ] more_env: [(env_pair name:FOO val:{(bar)} spids:[0]) (env_pair name:SPAM val:{(eggs)} spids:[6])] ) (CommandList children: [ (Assignment keyword: Assign_Readonly pairs: [ (assign_pair lhs:(LhsName name:ONE) op:Equal rhs:{(1)} spids:[2]) (assign_pair lhs:(LhsName name:TWO) op:Equal rhs:{(2)} spids:[5]) (assign_pair lhs:(LhsName name:THREE) op:Equal spids:[8]) ] spids: [0] ) ] ) osh/lex_test.pyc ............. ---------------------------------------------------------------------- Ran 13 tests in 0.070s OK [(Char_Literals, 'newline '), (Char_OneChar, '\\n'), (Char_Literals, ' NUL '), (Char_OneChar, '\\0'), (Char_Literals, ' octal '), (Char_Octal4, '\\0377'), (Char_Literals, ' hex '), (Char_Hex, '\\x00')] [(Char_Literals, 'unicode '), (Char_Unicode4, '\\u0065'), (Char_Literals, ' '), (Char_Unicode8, '\\U00000065')] [(Char_BadBackslash, '\\'), (Char_Literals, 'd '), (Char_OneChar, '\\e'), (Char_Literals, ' '), (Char_OneChar, '\\f'), (Char_Literals, ' '), (Char_BadBackslash, '\\'), (Char_Literals, 'g')] (token id:Char_Literals val:'foo bar' span_id:0) (token id:Char_OneChar val:'\\n' span_id:1) (token id:Left_SingleQuote val:"'" span_id:0) P '[^\\\\\\0]+' osh/word_parse_test.pyc .... --- ${array[0]} { (BracedVarSub token: bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [0 5] ) } --- ${array[5+5]} { (BracedVarSub token: bracket_op: (ArrayIndex expr: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 5)}) right: (ArithWord w:{(Lit_Digits 5)}) ) ) spids: [0 7] ) } --- ${array[@]} {(BracedVarSub token: bracket_op:(WholeArray op_id:Lit_At) spids:[0 5])} --- ${array[*]} {(BracedVarSub token: bracket_op:(WholeArray op_id:Arith_Star) spids:[0 5])} --- ${#} {(${ VSub_Pound '#')} --- ${!} {(${ VSub_Bang '!')} --- ${?} {(${ VSub_QMark '?')} --- ${var} {(${ VSub_Name var)} --- ${15} {(${ VSub_Number 15)} --- ${#var} {(BracedVarSub token: prefix_op:VSub_Pound spids:[0 3])} --- ${!ref} {(BracedVarSub token: prefix_op:VSub_Bang spids:[0 3])} --- ${##} {(BracedVarSub token: prefix_op:VSub_Pound spids:[0 3])} --- ${array[0]} { (BracedVarSub token: bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [0 5] ) } --- ${array[@]} {(BracedVarSub token: bracket_op:(WholeArray op_id:Lit_At) spids:[0 5])} --- ${#array[0]} { (BracedVarSub token: prefix_op: VSub_Pound bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [0 6] ) } --- ${!array[0]} { (BracedVarSub token: prefix_op: VSub_Bang bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [0 6] ) } --- ${var#prefix} { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{(prefix)}) spids: [0 4] ) } --- ${!var#prefix} { (BracedVarSub token: prefix_op: VSub_Bang suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{(prefix)}) spids: [0 5] ) } --- ${#var#prefix} --- ${##2} --- ${#@} {(BracedVarSub token: prefix_op:VSub_Pound spids:[0 3])} --- ${#11} {(BracedVarSub token: prefix_op:VSub_Pound spids:[0 3])} --- ${#str} {(BracedVarSub token: prefix_op:VSub_Pound spids:[0 3])} --- ${#array[0]} { (BracedVarSub token: prefix_op: VSub_Pound bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [0 6] ) } --- ${#array["key"]} { (BracedVarSub token: prefix_op: VSub_Pound bracket_op: (ArrayIndex expr:(ArithWord w:{(DQ (key))})) spids: [0 8] ) } --MULTI --- a=(1 2 3) {(Lit_VarLike 'a=') (ArrayLiteralPart words:[{(1)} {(2)} {(3)}])} a=(1 2 3) 0 (line_span line_id:0 col:0 length:2) --- foo {(foo)} foo 0 (line_span line_id:0 col:0 length:3) --- \$ {(EscapedLiteralPart token:)} \$ 0 (line_span line_id:0 col:0 length:2) --- '' {(SQ )} '' 0 (line_span line_id:0 col:0 length:1) --- 'sq' {(SQ )} 'sq' 0 (line_span line_id:0 col:0 length:1) --- "" {(DQ )} "" 0 (line_span line_id:0 col:0 length:1) --- "dq" {(DQ (dq))} "dq" 0 (line_span line_id:0 col:0 length:1) --- $(echo command sub) { (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(command)} {(sub)})]) left_token: spids: [0 6] ) } $(echo command sub) 0 (line_span line_id:0 col:0 length:2) --- $(( 1 + 2 )) { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 1)}) right: (ArithWord w:{(Lit_Digits 2)}) ) spids: [0 9] ) } $(( 1 + 2 )) 0 (line_span line_id:0 col:0 length:3) --- ~user {(Lit_TildeLike '~user')} ~user 0 (line_span line_id:0 col:0 length:5) --- ${var#} { (BracedVarSub token: suffix_..op: (StringUnary op_id:VOp1_Pound arg_word:{}) spids: [0 3] ) } ${var#} 0 (line_span line_id:0 col:0 length:2) --- ${var/pat/replace} { (BracedVarSub token: suffix_op: (PatSub pat:{(pat)} replace:{(replace)} do_all:F do_prefix:F do_suffix:F) spids: [0 6] ) } --- ${var//pat/replace} { (BracedVarSub token: suffix_op: (PatSub pat:{(pat)} replace:{(replace)} do_all:T do_prefix:F do_suffix:F) spids: [0 7] ) } --- ${var/%pat/replace} { (BracedVarSub token: suffix_op: (PatSub pat:{(pat)} replace:{(replace)} do_all:F do_prefix:F do_suffix:T) spids: [0 7] ) } --- ${var/#pat/replace} { (BracedVarSub token: suffix_op: (PatSub pat:{(pat)} replace:{(replace)} do_all:F do_prefix:T do_suffix:F) spids: [0 7] ) } --- ${var/pat} { (BracedVarSub token: suffix_op: (PatSub pat:{(pat)} do_all:F do_prefix:F do_suffix:F) spids: [0 4] ) } --- ${var//pat} { (BracedVarSub token: suffix_op: (PatSub pat:{(pat)} do_all:T do_prefix:F do_suffix:F) spids: [0 5] ) } --- ${var/pat//} { (BracedVarSub token: suffix_op: (PatSub pat:{(pat)} replace:{(Lit_Slash /)} do_all:F do_prefix:F do_suffix:F) spids: [0 6] ) } --- ${var/pat///} { (BracedVarSub token: suffix_op: (PatSub pat: {(pat)} replace: {(Lit_Slash /) (Lit_Slash /)} do_all: F do_prefix: F do_suffix: F ) spids: [0 7] ) } --- ${var/pat/"//"} { (BracedVarSub token: suffix_op: (PatSub pat:{(pat)} replace:{(DQ (//))} do_all:F do_prefix:F do_suffix:F) spids: [0 8] ) } --- ${var////\\/} { (BracedVarSub token: suffix_op: (PatSub pat: {(Lit_Slash /)} replace: {(EscapedLiteralPart token:) (Lit_Slash /)} do_all: T do_prefix: F do_suffix: F ) spids: [0 8] ) } --- ls "foo" {(ls)} {(DQ (foo))} (TokenWord token:) --- $(( 1 + 2 )) { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 1)}) right: (ArithWord w:{(Lit_Digits 2)}) ) spids: [0 9] ) } (TokenWord token:) --- $(echo $(( 1 )) ) { (CommandSubPart command_list: (CommandList children: [(C {(echo)} {(ArithSubPart anode:(ArithWord w:{(Lit_Digits 1)}) spids:[3 8])})] ) left_token: spids: [0 10] ) } (TokenWord token:) --- echo ${#array[@]} b {(echo)} { (BracedVarSub token: prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [2 8] ) } {(b)} (TokenWord token:) --- echo $(( ${#array[@]} )) {(echo)} { (ArithSubPart anode: (ArithWord w: { (BracedVarSub token: prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [4 10] ) } ) spids: [2 13] ) } (TokenWord token:) --- echo ${@%suffix} {(echo)} { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{(suffix)}) spids: [2 6] ) } (TokenWord token:) --- ${@} {(${ VSub_At '@')} (TokenWord token:) --- echo ${var,,} {(echo)} { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_DComma arg_word:{}) spids: [2 5] ) } (TokenWord token:) --- echo ${var,,?} {(echo)} { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_DComma arg_word:{('?')}) spids: [2 6] ) } (TokenWord token:) --- ${\ foo} {(${ VSub_Name foo)} (TokenWord token:) --- ${foo\ } {(${ VSub_Name foo)} (TokenWord token:) --- ${foo#\ yo} { (BracedVarSub token: suffix_op: ..(StringUnary op_id:VOp1_Pound arg_word:{(yo)}) spids: [0 5] ) } (TokenWord token:) --- "${foo#\ yo}" { (DQ (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{(yo)}) spids: [1 6] ) ) } (TokenWord token:) --- 1 + 2 {(Lit_Digits 1)} (TokenWord token:) {(Lit_Digits 2)} (TokenWord token:) --- a + b {(Lit_ArithVarLike a)} (TokenWord token:) {(Lit_ArithVarLike b)} (TokenWord token:) --- $a * $b {($ VSub_Name '$a')} (TokenWord token:) {($ VSub_Name '$b')} (TokenWord token:) --- ${a} * ${b} {(${ VSub_Name a)} (TokenWord token:) {(${ VSub_Name b)} (TokenWord token:) --- $(echo 1) * $(echo 2) { (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(1)})]) left_token: spids: [0 4] ) } (TokenWord token:) { (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(2)})]) left_token: spids: [8 12] ) } (TokenWord token:) --- `echo 1` + 2 { (CommandSubPart command_list: (CommandList children:[(C {(echo)} {(1)})]) left_token: spids: [0 4] ) } (TokenWord token:) {(Lit_Digits 2)} (TokenWord token:) --- $((1 + 2)) * $((3 + 4)) { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 1)}) right: (ArithWord w:{(Lit_Digits 2)}) ) spids: [0 7] ) } (TokenWord token:) { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 3)}) right: (ArithWord w:{(Lit_Digits 4)}) ) spids: [11 18] ) } (TokenWord token:) --- 'single quoted' {(SQ <'single quoted'>)} (TokenWord token:) --- "${a}" + "${b}" {(DQ (${ VSub_Name a))} (TokenWord token:) {(DQ (${ VSub_Name b))} (TokenWord token:) --- $# + $$ {($ VSub_Pound '$#')} (TokenWord token:) {($ VSub_Dollar '$$')} (TokenWord token:) --- $(( x[0] < 5 )) { (ArithSubPart anode: (ArithBinary op_id: Arith_Less left: (ArithBinary op_id: Arith_LBracket left: (ArithVarRef name:x) right: (ArithWord w:{(Lit_Digits 0)}) ) right: (ArithWord w:{(Lit_Digits 5)}) ) spids: [0 12] ) } (TokenWord token:) --- $(( ++i )) {(ArithSubPart anode:(UnaryAssign op_id:Arith_DPlus child:(LhsName name:i)) spids:[0 6])} (TokenWord token:) --- $(( i++ )) {(ArithSubPart anode:(UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) spids:[0 6])} (TokenWord token:) --- $(( x -= 1)) { (ArithSubPart anode: (BinaryAssign op_id: Arith_MinusEqual left: (LhsName name:x) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [0 8] ) } (TokenWord token:) --- $(( x |= 1)) { (ArithSubPart anode: (BinaryAssign op_id: Arith_PipeEqual left: (LhsName name:x) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [0 8] ) } (TokenWord token:) --- $(( x[0] = 1 )) { (ArithSubPart anode: (BinaryAssign op_id: Arith_Equal left: (LhsIndexedName name:x index:(ArithWord w:{(Lit_Digits 0)})) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [0 12] ) } (TokenWord token:) --- $(( 1 | 0 )) { (ArithSubPart anode: (ArithBinary op_id: Arith_Pipe left: (ArithWord w:{(Lit_Digits 1)}) right: (ArithWord w:{(Lit_Digits 0)}) ) spids: [0 9] ) } (TokenWord token:) --- $((0x$size)) { (ArithSubPart anode: (ArithWord w:{(Lit_Digits 0) (Lit_ArithVarLike x) ($ VSub_Name '$size')}) spids: [0 5] ) } (TokenWord token:) --- $(( f(x......... ---------------------------------------------------------------------- Ran 17 tests in 6.687s OK ) )) {(ArithSubPart anode:(FuncCall func:(ArithVarRef name:f) args:[(ArithVarRef name:x)]) spids:[0 8])} --- $(( f(1, 2, 3, 4) )) { (ArithSubPart anode: (FuncCall func: (ArithVarRef name:f) args: [ (ArithWord w:{(Lit_Digits 1)}) (ArithWord w:{(Lit_Digits 2)}) (ArithWord w:{(Lit_Digits 3)}) (ArithWord w:{(Lit_Digits 4)}) ] ) spids: [0 17] ) } --- ${foo:0} { (BracedVarSub token: suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 0)})) spids: [0 4] ) } --- ${foo:0:1} { (BracedVarSub token: suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 0)}) length:(ArithWord w:{(Lit_Digits 1)})) spids: [0 6] ) } --- ${foo:1+2:2+3} { (BracedVarSub token: suffix_op: (Slice begin: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 1)}) right: (ArithWord w:{(Lit_Digits 2)}) ) length: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 2)}) right: (ArithWord w:{(Lit_Digits 3)}) ) ) spids: [0 10] ) } --- ${foo::1} { (BracedVarSub token: suffix_op: (Slice length:(ArithWord w:{(Lit_Digits 1)})) spids: [0 5] ) } --- ${var:-default]} { (BracedVarSub token: suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{('default]')}) spids: [0 4] ) } --- ~/git/oilshell/oil {(Lit_TildeLike '~') (/git/oilshell/oil)} --- ~andy/git/oilshell/oil {(Lit_TildeLike '~andy') (/git/oilshell/oil)} --- ~andy_c/git/oilshell/oil {(Lit_TildeLike '~andy_c') (/git/oilshell/oil)} --- ~andy.c/git/oilshell/oil {(Lit_TildeLike '~andy.c') (/git/oilshell/oil)} --- ~andy-c/git/oilshell/oil {(Lit_TildeLike '~andy-c') (/git/oilshell/oil)} --- ~andy-c:git/oilshell/oil {(Lit_TildeLike '~andy-c') (Lit_Other ':') (git/oilshell/oil)} --- ${var#} { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{}) spids: [0 3] ) } --- ${var#prefix} { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{(prefix)}) spids: [0 4] ) } --- ${var##} { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{}) spids: [0 3] ) } --- ${var##prefix} { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{(prefix)}) spids: [0 4] ) } --- ${var%suffix} { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{(suffix)}) spids: [0 4] ) } --- ${var%%suffix} { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_DPercent arg_word:{(suffix)}) spids: [0 4] ) } --- ${name} {(${ VSub_Name name)} --- ${name[0]} { (BracedVarSub token: bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [0 5] ) } --- ${array[@]} {(BracedVarSub token: bracket_op:(WholeArray op_id:Lit_At) spids:[0 5])} ~/git/oilshell/oil/opy Ran 30 tests, 0 failures