From 96866f94a7fadb7fbbed383d24ccd7c4a3461e9c Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 19 Jun 2019 15:54:16 -0400 Subject: [PATCH] Adjust grammar checker to ignore LOAD_CODE --- pytest/test_grammar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytest/test_grammar.py b/pytest/test_grammar.py index fd2771c9..80f5e645 100644 --- a/pytest/test_grammar.py +++ b/pytest/test_grammar.py @@ -9,6 +9,7 @@ def test_grammar(): remain_tokens = set(tokens) - opcode_set remain_tokens = set([re.sub(r'_\d+$','', t) for t in remain_tokens]) remain_tokens = set([re.sub('_CONT$','', t) for t in remain_tokens]) + remain_tokens = set([re.sub('LOAD_CODE$','', t) for t in remain_tokens]) remain_tokens = set(remain_tokens) - opcode_set assert remain_tokens == set([]), \ "Remaining tokens %s\n====\n%s" % (remain_tokens, p.dump_grammar()) @@ -88,7 +89,7 @@ def test_grammar(): COME_FROM_EXCEPT_CLAUSE COME_FROM_LOOP COME_FROM_WITH COME_FROM_FINALLY ELSE - LOAD_GENEXPR LOAD_ASSERT LOAD_SETCOMP LOAD_DICTCOMP LOAD_STR + LOAD_GENEXPR LOAD_ASSERT LOAD_SETCOMP LOAD_DICTCOMP LOAD_STR LOAD_CODE LAMBDA_MARKER RETURN_END_IF RETURN_END_IF_LAMBDA RETURN_VALUE_LAMBDA RETURN_LAST """.split())