mirror of
https://github.com/CPunch/Cosmo.git
synced 2025-12-22 02:40:03 +00:00
Added modulo operator '%'
- added OP_MOD, which performs a modulo operation on the 2 <number> values on the stack. Pops the 2 values and pushes the result. - also added TOKEN_PERCENT to the lexer, and extended binary() in cparse.c to support it.
This commit is contained in:
@@ -144,6 +144,8 @@ int disasmInstr(CChunk *chunk, int offset, int indent) {
|
||||
return simpleInstruction("OP_MULT", offset);
|
||||
case OP_DIV:
|
||||
return simpleInstruction("OP_DIV", offset);
|
||||
case OP_MOD:
|
||||
return simpleInstruction("OP_MOD", offset);
|
||||
case OP_TRUE:
|
||||
return simpleInstruction("OP_TRUE", offset);
|
||||
case OP_FALSE:
|
||||
|
||||
Reference in New Issue
Block a user