Commit Graph

17 Commits

Author SHA1 Message Date
cd3047c271 WIP: removed stale error handling
currently, scripts seem to run fine. however I'm a bit worried about stack related issues. maybe i'll need to reset state->top as well? but not entirely sure
2023-08-29 14:07:45 -05:00
5c3e24fc39 refactoring and cleanup
cosmoB_loadOSLib -> cosmoB_loadOS
2023-08-24 23:36:32 -05:00
8c6ba18848 major main.c refactoring
- now takes command line arguments:
Usage: ./bin/cosmo [-clsr] [args]

available options are:
-c <in> <out>   compile <in> and dump to <out>
-l <in>         load dump from <in>
-s <in...>              compile and run <in...> script(s)
-r                      start the repl
2023-05-28 20:52:12 -05:00
54a959438b added cdump.[ch] and cundump.[ch] to makefile 2023-05-27 23:17:17 -05:00
517b0b9532 Removed '-Werror' to the Makefile 2021-06-11 15:01:53 -05:00
2050359d2f Added C99 support, refactored headers 2021-02-15 16:20:04 -06:00
461e1d0c15 Minor Makefile fix 2021-02-11 20:35:42 -06:00
2e07715a7d Added CMake support
should make integration into visual studio easier for people
2021-02-11 20:34:04 -06:00
84f7895684 Added modulo operator '%'
- 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.
2021-01-01 00:47:15 -06:00
e7212b939d Makefile now specifies C11 2020-12-26 22:03:14 -06:00
181ef8a18c Added dictionaries {}
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.
2020-12-09 20:32:42 -06:00
329d34aa43 fixed clang warnings 2020-11-17 13:17:23 -06:00
ffe4fc6930 disabled debug features by default 2020-11-12 17:02:12 -06:00
01b796460a refactored internal strings 2020-11-12 16:52:56 -06:00
aa975b7330 minor refactoring + non-zero int fixed 2020-11-05 19:53:55 -06:00
e1d33855c3 added basic objects 2020-11-03 22:10:51 -06:00
2e1b745624 Initial commit 2020-10-28 00:16:30 -05:00