Commit Graph

17 Commits

Author SHA1 Message Date
cd6744ab65 Minor refactor, added vm.* library
- cosmoV_pushObj() has been added
- cbaselib.h has been cleaned up a bit
2021-01-25 15:04:16 -06:00
c510c9aebf Minor table refactor, added cosmoV_compileString and loadstring() to baselib
cosmoV_compileString is recommended since it'll push the result (<error> or <closure>) onto the stack.

also, fixed some GC-related bugs, so yay!
2021-01-10 14:38:53 -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
7e9b61e018 minor refactor, fixed many warnings 2021-01-01 23:06:24 -06:00
31a852a127 Added cosmoV_pushFString(), and cosmoO_pushVFString().
cosmoV_error now pushes the error string onto the stack, as well as uses cosmoO_VFString to format strings.
cosmoV_concat is now entirely self contained, and is now stack based. Push the CValues you want to concat into strings onto the stack and call cosmoV_concat with the # of values you pushed.
2020-12-22 15:13:11 -06:00
de3a89ad4f cosmoV_register now uses the stack to pass params 2020-12-19 21:15:12 -06:00
48ceca1834 multiple return value support added to VM 2020-12-12 21:53:12 -06:00
6445dae04c added module names for functions 2020-12-09 12:23:16 -06:00
f8a062919f added cosmoM_addRoot & cosmoM_removeRoot 2020-12-07 15:53:23 -06:00
08b6dcbf4c CObjMethod refactor 2020-11-12 23:04:09 -06:00
40ae495aaf added input() to repl 2020-11-12 20:06:38 -06:00
c42a72dfad Major refactoring, added classes, many bug fixes 2020-11-09 19:44:12 -06:00
185380b2c0 removed unused code 2020-11-03 22:19:48 -06:00
293bab307b files ran from cli now have baselib again 2020-11-03 22:18:55 -06:00
fe93a0b715 better GC debugging, added base object for tables 2020-11-02 22:32:39 -06:00
a15c8d67a1 repl now shares state 2020-10-28 18:38:50 -05:00
2e1b745624 Initial commit 2020-10-28 00:16:30 -05:00