*** Running test-arglist ===== CASE: -n -c json write () ===== json write () ^ [ -c flag ]:1: Empty arg list not allowed ===== CASE: -n -c json write (42, indent=1) ===== (command.Simple blame_tok: more_env:[] words:[(w ) (w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] named_args:[(NamedArg name: value:(Const Expr_DecInt _))] right: ) is_last_cmd:F ) ===== CASE: -n -c json write (42; indent=2) ===== (command.Simple blame_tok: more_env:[] words:[(w ) (w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] semi_tok: named_args:[(NamedArg name: value:(Const Expr_DecInt _))] right: ) is_last_cmd:F ) ===== CASE: -n -c = toJson(42, indent=1) ===== (ExprCommand keyword: pos_args:[(Const Expr_DecInt _)] named_args:[ (NamedArg name: value:(Const Expr_DecInt _)) ] right: ) ) ) ===== CASE: -n -c = toJson(42; indent=2) ===== (ExprCommand keyword: pos_args:[(Const Expr_DecInt _)] semi_tok: named_args:[ (NamedArg name: value:(Const Expr_DecInt _)) ] right: ) ) ) ===== CASE: -n -c p (; n=true) ===== (command.Simple blame_tok: more_env:[] words:[(w )] typed_args:(ArgList left: pos_args:[] semi_tok: named_args:[(NamedArg name: value:(Const Expr_True _))] right: ) is_last_cmd:F ) ===== CASE: -n -c = f(; n=true) ===== (ExprCommand keyword: pos_args:[] semi_tok: named_args:[(NamedArg name: value:(Const Expr_True _))] right: ) ) ) ===== CASE: -n -c p (;) ===== (command.Simple blame_tok: more_env:[] words:[(w )] typed_args:(ArgList left: pos_args:[] semi_tok: named_args:[] right: ) is_last_cmd:F ) ===== CASE: -n -c = f(;) ===== (ExprCommand keyword: pos_args:[] semi_tok: named_args:[] right: ) ) ) ===== CASE: -n -c p (42;) ===== (command.Simple blame_tok: more_env:[] words:[(w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] semi_tok: named_args:[] right: ) is_last_cmd:F ) ===== CASE: -n -c = f(42;) ===== (ExprCommand keyword: pos_args:[(Const Expr_DecInt _)] semi_tok: named_args:[] right: ) ) ) ===== CASE: -n -c = f(42; n=true; block) ===== = f(42; n=true; block) ^ [ -c flag ]:1: Syntax error in expression (near Id.Op_Semi) ===== CASE: -n -c = f(42; ; block) ===== = f(42; ; block) ^ [ -c flag ]:1: Syntax error in expression (near Id.Op_Semi) ===== CASE: -n -c p (42; n=true; block) ===== (command.Simple blame_tok: more_env:[] words:[(w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] semi_tok: named_args:[(NamedArg name: value:(Const Expr_True _))] semi_tok2: block_expr:(Var block) right: ) is_last_cmd:F ) ===== CASE: -n -c p (42; ; block) ===== (command.Simple blame_tok: more_env:[] words:[(w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] semi_tok: named_args:[] semi_tok2: block_expr:(Var block) right: ) is_last_cmd:F ) ===== CASE: -n -c p (42; n=42; bad=3) ===== p (42; n=42; bad=3) ^~~ [ -c flag ]:1: Invalid block expression argument ===== CASE: -n -c p (42; n=42; ...bad) ===== p (42; n=42; ...bad) ^~~ [ -c flag ]:1: Invalid block expression argument ===== CASE: -n -c = f(; 42) ===== = f(; 42) ^~ [ -c flag ]:1: Positional arg can't appear in group of named args ===== CASE: -n -c = f(; name) ===== = f(; name) ^~~~ [ -c flag ]:1: Positional arg can't appear in group of named args ===== CASE: -n -c = f(; x for x in y) ===== = f(; x for x in y) ^ [ -c flag ]:1: Positional arg can't appear in group of named args OK test-arglist *** Running test-assert-left-brackets ===== CASE: -c var x = [42]; assert [ [42] === x] ===== OK test-assert-left-brackets *** Running test-blocks ===== CASE: -n -c >out { echo hi } ===== >out { echo hi } ^ [ -c flag ]:1: Unexpected typed args ===== CASE: -n -c a=1 b=2 { echo hi } ===== a=1 b=2 { echo hi } ^ [ -c flag ]:1: Unexpected typed args ===== CASE: -n -c break { echo hi } ===== break { echo hi } ^ [ -c flag ]:1: Unexpected typed args ===== CASE: -n -c cd / { echo hi } cd / ===== cd / { echo hi } cd / ^~ [ -c flag ]:1: Invalid word while parsing command line (Id.Word_Compound) OK test-blocks *** Running test-bug-1118 ===== CASE: -n -c var snippets = [{status: 42}] for snippet in (snippets) { if (snippet["status"] === 0) { echo hi } # The $ causes a weird error if ($snippet["status"] === 0) { echo hi } } ===== if ($snippet["status"] === 0) { ^~~~~~~~ [ -c flag ]:9: In expressions, remove $ and use `snippet`, or sometimes "$snippet" ===== CASE: -n -c var content = [ 1, 2, 4 ] var count = 0 # The $ causes a weird error while (count < $len(content)) { setvar count += 1 } ===== while (count < $len(content)) { ^~~~ [ -c flag ]:6: In expressions, remove $ and use `len`, or sometimes "$len" OK test-bug-1118 *** Running test-bug-1826 ===== CASE: -n -c echo b'\xff' ===== echo b'\xff' ^ [ -c flag ]:1: Invalid char escape in C-style string literal (OILS-ERR-11) ===== CASE: -n -c var s = b'\xff' ===== var s = b'\xff' ^ [ -c flag ]:1: Invalid char escape in C-style string literal (OILS-ERR-11) [echo b'\] ===== CASE: -n -c echo b'\ ===== echo b'\ ^ [ -c flag ]:1: Invalid char escape in C-style string literal (OILS-ERR-11) [var s = b'\] ===== CASE: -n -c var s = b'\ ===== var s = b'\ ^ [ -c flag ]:1: Invalid char escape in C-style string literal (OILS-ERR-11) [var s = $'\] ===== CASE: -n -c var s = $'\ ===== var s = $'\ ^~ [ -c flag ]:1: Instead of $'', use J8 strings like b'' (no_parse_osh) OK test-bug-1826 *** Running test-bug-1850 ===== CASE: -n -c pp test_ (42); pp line (43) ===== (command.CommandList children:[ (command.Sentence child:(command.Simple blame_tok: more_env:[] words:[(w ) (w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] named_args:[] right: ) is_last_cmd:F ) terminator: ) (command.Simple blame_tok: more_env:[] words:[(w ) (w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] named_args:[] right: ) is_last_cmd:F ) ] ) ===== CASE: -n -c pp test_ (42) extra ===== pp test_ (42) extra ^~~~~ [ -c flag ]:1: Invalid word while parsing command line (Id.Word_Compound) ===== CASE: -n -c pp test_ (42), echo ===== pp test_ (42), echo ^ [ -c flag ]:1: Invalid word while parsing command line (Id.Word_Compound) ===== CASE: -n -c pp test_ @(echo), echo ===== pp test_ @(echo), echo ^ [ -c flag ]:1: Unexpected token after @() ===== CASE: -n -c pp test_ (42) ===== (command.Simple blame_tok: more_env:[] words:[(w ) (w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] named_args:[] right: ) is_last_cmd:F ) ===== CASE: -n -c pp test_ (42) ===== (command.Simple blame_tok: more_env:[] words:[(w ) (w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] named_args:[] right: ) is_last_cmd:F ) ===== CASE: -n -c pp test_ (42); ===== (command.Sentence child:(command.Simple blame_tok: more_env:[] words:[(w ) (w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] named_args:[] right: ) is_last_cmd:F ) terminator: ) ===== CASE: -n -c pp test_ (42) { echo hi } ===== (command.Simple blame_tok: more_env:[] words:[(w ) (w )] typed_args:(ArgList left: pos_args:[(Const Expr_DecInt _)] named_args:[] right: ) block:(LiteralBlock brace_group:(BraceGroup left: children:[(C (w ) (w ))] right: ) code_str:" echo hi " ) is_last_cmd:F ) ===== CASE: -n -c pp test_ (42), pp line (43) ===== pp test_ (42), pp line (43) ^ [ -c flag ]:1: Invalid word while parsing command line (Id.Word_Compound) OK test-bug-1850 *** Running test-bug-1850-more ===== CASE: -n -c assert (42)extra ===== assert (42)extra ^~~~~ [ -c flag ]:1: Invalid word while parsing command line (Id.Word_Compound) ===== CASE: -n -c assert (42) extra ===== assert (42) extra ^~~~~ [ -c flag ]:1: Invalid word while parsing command line (Id.Word_Compound) ===== CASE: -n -c assert [42]extra ===== assert [42]extra ^~~~~ [ -c flag ]:1: Invalid word while parsing command line (Id.Word_Compound) ===== CASE: -n -c assert [42] extra ===== assert [42] extra ^~~~~ [ -c flag ]:1: Invalid word while parsing command line (Id.Word_Compound) OK test-bug-1850-more *** Running test-bug_1825_backslashes ===== CASE: -n -c echo $'trailing\ ' ===== (C (w ) (w (SingleQuoted left: sval:"trailing\\\n" right: ) ) ) OK test-bug_1825_backslashes *** Running test-command-simple-more ===== CASE: -n -c foo=1 ===== (command.ShAssignment left: pos_args:[(Const Expr_DecInt _)] named_args:[] right: ) is_last_cmd:F ) ===== CASE: -n -c foo=1 cmd >out (42) ===== (command.Simple blame_tok: more_env:[(EnvPair left: pos_args:[(Const Expr_DecInt _)] named_args:[] right: ) is_last_cmd:F redirects:[ (Redir op:"> loc:(redir_loc.Fd fd:1) arg:(w )) ] ) OK test-command-simple-more *** Running test-destructure ===== CASE: -n -c func f() { const x, y = 3, 4 #setvar x = 5 setvar y = 6 } ===== const x, y = 3, 4 ^~~~~ [ -c flag ]:3: const can't be inside proc or func. Use var instead. ===== CASE: -n -c func f() { var x, y = 3, 4 var y = 6 } ===== var y = 6 ^ [ -c flag ]:5: 'y' was already declared ===== CASE: -n -c func f() { var x, y = 3, 4 const y = 6 } ===== const y = 6 ^~~~~ [ -c flag ]:5: const can't be inside proc or func. Use var instead. OK test-destructure *** Running test-eggex ===== CASE: -n -c = /%start dot %end \n \u{ff}/ ===== Traceback (most recent call last): File "/home/uke/oil/bin/oils_for_unix.py", line 263, in sys.exit(main(sys.argv)) File "/home/uke/oil/bin/oils_for_unix.py", line 232, in main return AppBundleMain(argv) File "/home/uke/oil/bin/oils_for_unix.py", line 198, in AppBundleMain bash_compat=(applet == 'bash')) File "/home/uke/oil/core/shell.py", line 1261, in Main ui.PrintAst(node, flag) File "/home/uke/oil/display/ui.py", line 540, in PrintAst tree = node.PrettyTree(do_abbrev) File "/home/uke/oil/_devbuild/gen/syntax_asdl.py", line 7531, in PrettyTree x1 = self.e.PrettyTree(do_abbrev, trav=trav) File "/home/uke/oil/_devbuild/gen/syntax_asdl.py", line 7028, in PrettyTree x1 = self.regex.PrettyTree(do_abbrev, trav=trav) File "/home/uke/oil/_devbuild/gen/syntax_asdl.py", line 5983, in PrettyTree i0.PrettyTree(do_abbrev, trav=trav)) File "/home/uke/oil/_devbuild/gen/syntax_asdl.py", line 5805, in PrettyTree x1 = hnode.Leaf(Id_str(self.id, dot=False), color_e.UserType) NameError: global name 'Id_str' is not defined test/ysh-parse-errors.sh: fatal: Should parse with bin/osh: expected status 0, got 1 FAIL test-eggex