diff --git a/ASSEMBLY.md b/ASSEMBLY.md index e18ea7b..ab55514 100644 --- a/ASSEMBLY.md +++ b/ASSEMBLY.md @@ -16,7 +16,7 @@ for cross-version support. ## Meta Instructions (dynamically decide what to use) -* LABEL \: an bytecode label, can be used for jumps (use bytecodemanipulation.assembler.target.label(\) when trying to jump to a instruction not in ASM, but in pure python) +* LABEL \: a bytecode label, can be used for jumps (use bytecodemanipulation.assembler.target.label(\) when trying to jump to a instruction not in ASM, but in pure python) * LOAD \ \['->' \]: Pushes the global or local variable to the stack * STORE \ \['(' \ ')']: stores TOS or value of 'expression' in the local or global variable diff --git a/bytecodemanipulation/assembler/Parser.py b/bytecodemanipulation/assembler/Parser.py index 6b73924..c87697c 100644 --- a/bytecodemanipulation/assembler/Parser.py +++ b/bytecodemanipulation/assembler/Parser.py @@ -285,7 +285,7 @@ def try_parse_custom_assembly( ).assemblies: if macro.allow_assembly_instr: self.rollback() - print(name) + # print(name) return AbstractCallAssembly.IMPLEMENTATION.consume_macro_call( self, scope ) diff --git a/bytecodemanipulation/data/shared/instructions/AbstractInstruction.py b/bytecodemanipulation/data/shared/instructions/AbstractInstruction.py index 441ae51..754a17f 100644 --- a/bytecodemanipulation/data/shared/instructions/AbstractInstruction.py +++ b/bytecodemanipulation/data/shared/instructions/AbstractInstruction.py @@ -28,6 +28,13 @@ class AbstractAssemblyInstruction(AbstractExpression, IAssemblyStructureVisitabl NAME: str | None = None IMPLEMENTATION: typing.Type["AbstractAssemblyInstruction"] | None = None + @classmethod + def register(cls): + from bytecodemanipulation.assembler.Parser import Parser + + Parser.register(cls) + return cls + @classmethod def __init_subclass__(cls, **kwargs): # copy the class definition into all superclasses inheriting from AbstractAssemblyInstruction