Skip to content

Commit

Permalink
last code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ruskaof committed Dec 18, 2023
1 parent 6fd2f83 commit 92733e9
Show file tree
Hide file tree
Showing 13 changed files with 10,711 additions and 8,776 deletions.
4 changes: 2 additions & 2 deletions computer_simulator/isa.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Instruction:
def __str__(self) -> str:
r = f"{self.opcode}"
if self.arg:
r += f" arg - {self.arg}"
r += f" arg[{self.arg}]"
if self.comment:
r += f" ({self.comment})"
return f"Instruction({r})"
return f"Instr({r})"
3 changes: 2 additions & 1 deletion computer_simulator/translator/expression_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ def handle_token_read_char(tokens: list[Token], idx: int, result: Program, start

result.memory.append(Instruction(Opcode.IN, None))
result.memory.append(
Instruction(Opcode.ST, Arg(cast(int, result.get_var_sp_offset(varname)), ArgType.STACK_OFFSET)))
Instruction(Opcode.ST, Arg(cast(int, result.get_var_sp_offset(varname)), ArgType.STACK_OFFSET))
)

return get_expr_end_idx(tokens, idx + 2, started_with_open_bracket)

Expand Down
339 changes: 168 additions & 171 deletions golden/cat.yml

Large diffs are not rendered by default.

1,101 changes: 550 additions & 551 deletions golden/every_statement_is_expression.yml

Large diffs are not rendered by default.

1,723 changes: 860 additions & 863 deletions golden/function.yml

Large diffs are not rendered by default.

741 changes: 370 additions & 371 deletions golden/hello.yml

Large diffs are not rendered by default.

Loading

0 comments on commit 92733e9

Please sign in to comment.