language

some fools attempt at an interpreted language
Log | Files | Refs | README

commit d68d19323101178d18b319750358b103918e85f2
parent 5f2f2f1ff2f7d7aeca11f109b207aea0fdd985c2
Author: Paul Longtine <paul@banna.tech>
Date:   Thu, 28 May 2020 02:01:22 -0400

implemented OP_MOD in expression handler

Diffstat:
Msrc/lc/interpreter.py | 1+
Asrc/lc/test_files/new_mod_op.ti | 2++
2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/lc/interpreter.py b/src/lc/interpreter.py @@ -147,6 +147,7 @@ class Expression(AbstractToken): ["-", Opcode(OP_SUB)], ["*", Opcode(OP_MULT)], ["/", Opcode(OP_DIV)], + ["%", Opcode(OP_MOD)], ["==", Opcode(OP_EQ)], ["!=", Opcode(OP_NEQ)], [">", Opcode(OP_GTHAN)], diff --git a/src/lc/test_files/new_mod_op.ti b/src/lc/test_files/new_mod_op.ti @@ -0,0 +1 @@ +int x = 4 % 2; +\ No newline at end of file