mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-06-24 18:30:05 +00:00
Added iterable objects
__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.
This commit is contained in:
@@ -36,6 +36,8 @@ typedef enum {
|
||||
OP_SETOBJECT,
|
||||
OP_GETOBJECT,
|
||||
OP_INVOKE,
|
||||
OP_ITER, // if stack[top] is an object, __iter is expected and called, else if stack[top] is a dictionary a dummy iterator object is made (SEE: cosmoV_makeIter())
|
||||
OP_NEXT, // if stack[top] is an object, __next is expected and called, expecting uint8_t return values. if stack[top] after calling is nil, jump uint16_t
|
||||
|
||||
// ARITHMETIC
|
||||
OP_ADD,
|
||||
|
||||
Reference in New Issue
Block a user