interpreter: make linter happier
This commit is contained in:
parent
ea4a0c2ff1
commit
5623bebe34
1 changed files with 6 additions and 6 deletions
|
|
@ -137,10 +137,11 @@ class VirtualMachine:
|
||||||
def execute_one(self, instruction: ir.IRAction):
|
def execute_one(self, instruction: ir.IRAction):
|
||||||
match type(instruction):
|
match type(instruction):
|
||||||
case ir.IRAdd | ir.IRMul | ir.IRDiv | ir.IRInvert | ir.IRNegation:
|
case ir.IRAdd | ir.IRMul | ir.IRDiv | ir.IRInvert | ir.IRNegation:
|
||||||
_operation = operations.get(instruction.__class__,
|
ins: ir.IRAdd | ir.IRMul = typing.cast(ir.IRAdd | ir.IRMul, instruction)
|
||||||
|
|
||||||
|
_operation = operations.get(ins.__class__,
|
||||||
lambda _: None)
|
lambda _: None)
|
||||||
# noinspection PyTypeChecker
|
|
||||||
ins: ir.IRAdd | ir.IRMul = instruction
|
|
||||||
pprinted_input_values = self.pprint_values(ins.reads)
|
pprinted_input_values = self.pprint_values(ins.reads)
|
||||||
|
|
||||||
values = list(self.get_values(ins.reads))
|
values = list(self.get_values(ins.reads))
|
||||||
|
|
@ -160,8 +161,7 @@ class VirtualMachine:
|
||||||
f"\t{_operation.__name__}: {pprinted_input_values} = {hex(result)} : store into {ins.dest.codegen()}")
|
f"\t{_operation.__name__}: {pprinted_input_values} = {hex(result)} : store into {ins.dest.codegen()}")
|
||||||
|
|
||||||
case ir.IRMove:
|
case ir.IRMove:
|
||||||
# noinspection PyTypeChecker
|
ins: ir.IRMove = typing.cast(ir.IRMove, instruction)
|
||||||
ins: ir.IRMove = instruction
|
|
||||||
|
|
||||||
pprinted_input_value = self.pprint_values((ins.source,))
|
pprinted_input_value = self.pprint_values((ins.source,))
|
||||||
|
|
||||||
|
|
@ -170,7 +170,7 @@ class VirtualMachine:
|
||||||
|
|
||||||
logger.debug(f"\tmove: {pprinted_input_value} : store into {ins.dest.codegen()}")
|
logger.debug(f"\tmove: {pprinted_input_value} : store into {ins.dest.codegen()}")
|
||||||
case ir.IRCall:
|
case ir.IRCall:
|
||||||
ins: ir.IRCall = instruction
|
ins: ir.IRCall = typing.cast(ir.IRCall, instruction)
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"\tFully-qualified function: {ins.function.fq_identifier}, location: {ins.function.location}")
|
f"\tFully-qualified function: {ins.function.fq_identifier}, location: {ins.function.location}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue