Commit Graph

23 Commits

Author SHA1 Message Date
Luna d2e865adfc fix for latest zig 2019-11-02 10:22:23 -03:00
Luna 036e76d3a5 fix for latest zig 2019-06-30 00:01:03 -03:00
Luna d7b78e09e3 finish impl for local vars 2019-06-03 16:24:54 -03:00
Luna 26d299cd23 add local/global "switch" 2019-06-03 16:10:49 -03:00
Luna 69dda36d16 add SetGlobal/SetGlobalLong opcodes
- main: split compile/runtime error messages
2019-06-03 01:41:22 -03:00
Luna 8bc220d2f8 chunk: split writing side-effects into own function
split writeConstant() into that and writeConstantRaw() for the places
where we don't want OP_CONSTANT written as well.

this caused a bug where doing `"some const string" + x` would cause an
unecessary OP_CONSTANT to be added for the x variable and would cause
the wrong result to be given.

 - main: reset stack on repl tick (?)
2019-06-03 00:55:50 -03:00
Luna 922f3c530c chunk: fix disasm on the new const-load op codes 2019-06-03 00:07:11 -03:00
Luna 005981fbbd vm: add getglobal support 2019-06-02 23:57:28 -03:00
Luna 887cb1adea add emitting of GetGlobal/GetGlobalLong 2019-06-02 23:43:12 -03:00
Luna 3a6df2d9ea add basic global variable support
- chunk: make writeConstant return a ConstantIndex for better
    integration with the (optional) OP_CONST_LONG
 - compiler: quickfix emitConstant()
 - vm: add a global ValueMap
2019-06-02 22:52:19 -03:00
Luna 06df2d37ee add expression statements 2019-06-02 18:04:36 -03:00
Luna bea6e34365 add print statement
- remove opcode return's use as debug
2019-06-02 17:28:54 -03:00
Luna 71dba5c77d vm: add greater and less 2019-06-02 00:23:50 -03:00
Luna 15c58a2216 comparison operators, part 1 2019-06-02 00:16:33 -03:00
Luna 39e28f01ac chunk: add printing of OP_NOT 2019-06-02 00:03:54 -03:00
Luna c5d704a34f add not operator 2019-06-02 00:02:37 -03:00
Luna 1d774c6011 add support for nil, true and false literal values 2019-06-01 23:44:59 -03:00
Luna 3377d1675c vm, chunk: add binary operators 2019-06-01 15:40:18 -03:00
Luna 2822676707 vm: add negate opcode 2019-06-01 15:27:19 -03:00
Luna 14fa63e1f6 finish impl for ConstantLong 2019-06-01 14:18:44 -03:00
Luna 2d33e03efb add incomplete ConstantLong instruction
- move ValueList's count to usize for ConstantLong
2019-06-01 02:06:23 -03:00
Luna ba78b39300 add constant values to the virtual machine 2019-06-01 01:46:01 -03:00
Luna c4401dc8cf moving to the virtual machine part of the book, pt 1
the java part would still fuck me up since it lies on OOP stuff
that zig doesnt provide, so i'm skipping towards the C part of the book
which will hopefully be more understandable from a zig perspective.
2019-06-01 01:20:06 -03:00