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:
2020-12-15 21:21:51 -06:00
parent 4f3f594b82
commit e5eca7bed6
9 changed files with 181 additions and 9 deletions

View File

@@ -13,11 +13,13 @@ typedef struct CCallFrame {
} CCallFrame;
typedef enum IStringEnum {
ISTRING_INIT, // __init
ISTRING_INDEX, // __index
ISTRING_NEWINDEX, // __newindex
ISTRING_GETTER, // __getter
ISTRING_SETTER, // __setter
ISTRING_INIT, // __init
ISTRING_INDEX, // __index
ISTRING_NEWINDEX, // __newindex
ISTRING_GETTER, // __getter
ISTRING_SETTER, // __setter
ISTRING_ITER, // __iter
ISTRING_NEXT, // __next
ISTRING_MAX
} IStringEnum;