Commit Graph

19 Commits

Author SHA1 Message Date
1351ff63b1 Added CObj->proto support, state->protoObjects defines default protos for each COBJ type
a lot of refactoring in the VM
2021-01-07 19:50:36 -06:00
eb2f50e456 Added CObjError, cosmoV_throw(), pcall(), and cosmoV_printError()
Errors are now handled very differently, parser errors and VM errors are now treated the same.
When cosmoV_error is called, cosmoV_throw is also called, which formats the error object and sets the panic state.
state->error now points to the latest CObjError when state->panic is true. To get a nice formatted Objection message, use
cosmoV_printError() and pass the state->error. pcall() was added to the standard base library. When called, the first argument
passed is called with the subsequent arguments given. If the call completed successfully, `true`,`nil` is returned. However
when an error occurs during the call, `false`,`<error>` is returned. Simply print the `<error>` to retrieve the error string.
2021-01-05 22:27:59 -06:00
adb2381b4f added __tostring IString, added expressionPrecedence() to cparse.c
additional minor refactoring
2021-01-03 17:33:10 -06:00
7e9b61e018 minor refactor, fixed many warnings 2021-01-01 23:06:24 -06:00
509823e1bc detect stack overflows 2021-01-01 19:20:24 -06:00
de3a89ad4f cosmoV_register now uses the stack to pass params 2020-12-19 21:15:12 -06:00
0beeee0fdf Added dictionary support to OP_ITER
ISTRING_RESERVED was added to iStrings
call & callCFunction now use memmove instead of memcpy
Additionally, added cosmoO_setUserP, cosmoO_getUserP, cosmoO_setUserI and cosmoO_getUserI to the C API.
2020-12-17 19:44:04 -06:00
e5eca7bed6 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.
2020-12-15 21:21:51 -06:00
b1facfc92f smarter caching 2020-12-09 20:46:20 -06:00
f8a062919f added cosmoM_addRoot & cosmoM_removeRoot 2020-12-07 15:53:23 -06:00
aff011a8d1 minor refactoring 2020-12-07 14:35:14 -06:00
d00b803e6f added __setter and __getter 2020-12-06 14:11:33 -06:00
bb11b3b309 added support for __newindex 2020-11-24 15:16:37 -06:00
204bec3d0a added IStrings, added __index functionality 2020-11-16 19:58:16 -06:00
c7be39a5d4 renamed metaobjects to protoobjects 2020-11-15 12:22:11 -06:00
08b6dcbf4c CObjMethod refactor 2020-11-12 23:04:09 -06:00
01b796460a refactored internal strings 2020-11-12 16:52:56 -06:00
c42a72dfad Major refactoring, added classes, many bug fixes 2020-11-09 19:44:12 -06:00
2e1b745624 Initial commit 2020-10-28 00:16:30 -05:00