diff --git a/stepper.py b/stepper.py index 769c2df..5d11eaa 100644 --- a/stepper.py +++ b/stepper.py @@ -1,6 +1,8 @@ import ll import parser +from enum import Enum + def TODO(msg): print('TODO: not implemented yet at {}' @@ -17,7 +19,8 @@ def warn(msg): .format(msg)) -GARBAGE = '<>' +class Garbage(Enum): + GARBAGE = '<>' def step(insns, terminator, blocks, stack_frames, ssa_env, global_env, memory, @@ -55,7 +58,8 @@ def step(insns, terminator, blocks, stack_frames, ssa_env, global_env, memory, ptr = len(memory) for i in range(max(size, 1)): - memory.append(GARBAGE) + memory.append(Garbage.GARBAGE) + res = ptr elif isinstance(next_insn, ll.Load): TODO('Load')