- 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.
a LoopState was added to the CCompilerState struct which keeps track of breaks, start chunk index, and the start scope of the active loop.
Also, break.cosmo was added to the examples directory, 'continue' and 'break' work as expected.
__iter and __next are now reserved IStrings, OP_NEXT and OP_ITER have also been added. A new token (TOKEN_IN) has been added to the lexer. The parser now supports the for each loop (for i, ... in <object> do ... end).
savedPushed has been removed from the CCompilerState struct.
Objects are now separate from {} dictionaries
the . operator now only indexes fields on objects, the [] operator can only be used on objects if the __index or __newindex functions are defined
Additionally 4 new instructions have been added to the VM: OP_NEWDICT, OP_INDEX, OP_INCINDEX, and OP_NEWINDEX.
The syntax to create a dictionary is as follows { <key> : <value>, <otherkey> : <othervalue> } eg. { "hello" : "world", "foo" : 1337 }
The Lexer & Parser was extended to add the TOKEN_COLON ':' token.