Handle walrus operator

Or rather set precedence on call_stmt and expr_stmt

Adjust pytest test_single_compile so it works now
This commit is contained in:
rocky
2022-04-12 05:21:13 -04:00
parent e7fd592313
commit a1fe069c8c
7 changed files with 104 additions and 70 deletions

View File

@@ -43,6 +43,13 @@ class Python37Parser(Python37BaseParser):
call_stmt ::= expr POP_TOP
"""
def p_eval_mode(self, args):
"""
# eval-mode compilation. Single-mode interactive compilation
# adds another rule.
expr_stmt ::= expr POP_TOP
"""
def p_stmt(self, args):
"""
pass ::=
@@ -99,6 +106,7 @@ class Python37Parser(Python37BaseParser):
else_suite_opt ::= pass
stmt ::= classdef
stmt ::= expr_stmt
stmt ::= call_stmt
stmt ::= ifstmt