Add 3.6 STORE_ANNOTATION

This commit is contained in:
x0ret
2019-06-09 00:49:50 +04:30
committed by rocky
parent efe0914814
commit 21fd506fbb
2 changed files with 12 additions and 0 deletions

View File

@@ -143,6 +143,11 @@ class Python36Parser(Python35Parser):
COME_FROM_FINALLY
compare_chained2 ::= expr COMPARE_OP come_froms JUMP_FORWARD
stmt ::= SETUP_ANNOTATIONS
stmt ::= annotated_assign
annotated_assign ::= expr store store_annotation
store_annotation ::= LOAD_NAME STORE_ANNOTATION
"""
def customize_grammar_rules(self, tokens, customize):

View File

@@ -60,6 +60,13 @@ def customize_for_version36(self, version):
'call_ex' : (
'%c(%p)',
(0, 'expr'), (1, 100)),
'store_annotation': (
'%|%[1]{pattr}: %c',
0
),
'annotated_assign': (
'%|%c = %p\n',
(-1, 'store_annotation'), (0, 200))
})