Commit Graph

13 Commits

Author SHA1 Message Date
CPunch 517b0b9532 Removed '-Werror' to the Makefile 2021-06-11 15:01:53 -05:00
cpunch 2050359d2f Added C99 support, refactored headers 2021-02-15 16:20:04 -06:00
cpunch 461e1d0c15 Minor Makefile fix 2021-02-11 20:35:42 -06:00
cpunch 2e07715a7d Added CMake support
should make integration into visual studio easier for people
2021-02-11 20:34:04 -06:00
CPunch 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
CPunch e7212b939d Makefile now specifies C11 2020-12-26 22:03:14 -06:00
CPunch 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
CPunch 329d34aa43 fixed clang warnings 2020-11-17 13:17:23 -06:00
CPunch ffe4fc6930 disabled debug features by default 2020-11-12 17:02:12 -06:00
CPunch 01b796460a refactored internal strings 2020-11-12 16:52:56 -06:00
CPunch aa975b7330 minor refactoring + non-zero int fixed 2020-11-05 19:53:55 -06:00
CPunch e1d33855c3 added basic objects 2020-11-03 22:10:51 -06:00
CPunch 2e1b745624 Initial commit 2020-10-28 00:16:30 -05:00