*** 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 } } ===== 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 186, in AppBundleMain return shell.Main(lang, arg_r, environ, login_shell, loader, readline) File "/home/uke/oil/core/shell.py", line 1251, in Main node = main_loop.ParseWholeFile(c_parser) File "/home/uke/oil/core/main_loop.py", line 428, in ParseWholeFile node = c_parser.ParseLogicalLine() # can raise ParseError File "/home/uke/oil/osh/cmd_parse.py", line 2839, in ParseLogicalLine node = self._ParseCommandLine() File "/home/uke/oil/osh/cmd_parse.py", line 2695, in _ParseCommandLine child = self.ParseAndOr() File "/home/uke/oil/osh/cmd_parse.py", line 2619, in ParseAndOr return self._ParseAndOr() File "/home/uke/oil/osh/cmd_parse.py", line 2630, in _ParseAndOr child = self.ParsePipeline() File "/home/uke/oil/osh/cmd_parse.py", line 2578, in ParsePipeline child = self.ParseCommand() File "/home/uke/oil/osh/cmd_parse.py", line 2496, in ParseCommand return self.ParseCompoundCommand() File "/home/uke/oil/osh/cmd_parse.py", line 2082, in ParseCompoundCommand return self.ParseFor() File "/home/uke/oil/osh/cmd_parse.py", line 1624, in ParseFor n2 = self._ParseForEachLoop(for_kw) File "/home/uke/oil/osh/cmd_parse.py", line 1596, in _ParseForEachLoop node.body = self.ParseBraceGroup() File "/home/uke/oil/osh/cmd_parse.py", line 1365, in ParseBraceGroup c_list = self._ParseCommandList() File "/home/uke/oil/osh/cmd_parse.py", line 2823, in _ParseCommandList return self._ParseCommandTerm() File "/home/uke/oil/osh/cmd_parse.py", line 2760, in _ParseCommandTerm child = self.ParseAndOr() File "/home/uke/oil/osh/cmd_parse.py", line 2619, in ParseAndOr return self._ParseAndOr() File "/home/uke/oil/osh/cmd_parse.py", line 2630, in _ParseAndOr child = self.ParsePipeline() File "/home/uke/oil/osh/cmd_parse.py", line 2578, in ParsePipeline child = self.ParseCommand() File "/home/uke/oil/osh/cmd_parse.py", line 2496, in ParseCommand return self.ParseCompoundCommand() File "/home/uke/oil/osh/cmd_parse.py", line 2089, in ParseCompoundCommand n4 = self.ParseIf() File "/home/uke/oil/osh/cmd_parse.py", line 2012, in ParseIf enode = self.w_parser.ParseYshExprForCommand() File "/home/uke/oil/osh/word_parse.py", line 1421, in ParseYshExprForCommand enode, _ = self.parse_ctx.ParseYshExpr(self.lexer, grammar_nt.ysh_expr) File "/home/uke/oil/frontend/parse_lib.py", line 355, in ParseYshExpr pnode, last_token = e_parser.Parse(lx, start_symbol) File "/home/uke/oil/ysh/expr_parse.py", line 357, in Parse self.push_parser, lexer) File "/home/uke/oil/ysh/expr_parse.py", line 273, in _PushYshTokens last_token = w_parser.ReadDoubleQuoted(left_token, parts) File "/home/uke/oil/osh/word_parse.py", line 1200, in ReadDoubleQuoted self._ReadLikeDQ(left_token, True, parts) File "/home/uke/oil/osh/word_parse.py", line 1100, in _ReadLikeDQ elif self.token_type == Id.Lit_EscapedDoubleQuote: AttributeError: type object 'Id' has no attribute 'Lit_EscapedDoubleQuote' test/ysh-parse-errors.sh: fatal: Should NOT parse with bin/ysh: expected status 2, got 1 FAIL test-bug-1118