Start handling BUILD_MAP (a class of dict)

This commit is contained in:
rocky
2022-04-26 15:37:42 -04:00
parent 81ff994a41
commit c25fa61e33
5 changed files with 135 additions and 3 deletions

View File

@@ -748,6 +748,12 @@ class Python3Parser(PythonParser):
kvlist_n = "expr " * (token.attr)
rule = "dict ::= %sLOAD_CONST %s" % (kvlist_n, opname)
self.addRule(rule, nop_func)
elif opname.startswith("BUILD_DICT_OLDER"):
rule = """dict ::= COLLECTION_START key_value_pairs BUILD_DICT_OLDER
key_value_pairs ::= key_value_pair+
key_value_pair ::= ADD_KEY ADD_VALUE
"""
self.addRule(rule, nop_func)
elif opname.startswith("BUILD_LIST_UNPACK"):
v = token.attr
rule = "build_list_unpack ::= %s%s" % ("expr " * v, opname)