Commit graph

39 commits

Author SHA1 Message Date
1d774c6011 add support for nil, true and false literal values 2019-06-01 23:44:59 -03:00
ec652b29d9 remove print debug 2019-06-01 23:35:13 -03:00
589413488c move towards dynamically typed values
- remove InterpretResult as an enum, replace by error.
 - scanner: fix peekNext()
 - vm: add runtime errors, add VM.peek()
2019-06-01 23:33:53 -03:00
0f8e19adf1 compiler: finish parser (for math expressions) 2019-06-01 21:32:25 -03:00
230fef20b5 add other bytecode emitters 2019-06-01 20:48:26 -03:00
2736bee8d8 scanner: remove debug print 2019-06-01 20:34:09 -03:00
e1d0e3ec0b add basic compiler code 2019-06-01 20:33:43 -03:00
7d7aabbdd7 scanner: add keyword handling (copied off the old scanner)
as with most things, lol
2019-06-01 17:20:50 -03:00
d62c58a195 scanner: add identifiers 2019-06-01 17:15:35 -03:00
566d8313f3 add number tokens 2019-06-01 17:13:50 -03:00
9d1d253c94 scanner: fix peekNext 2019-06-01 17:12:00 -03:00
27b04e1612 scanner: add basic error handling, strings, comments 2019-06-01 17:07:22 -03:00
f4f1fe1fbc scanner: add whitespace handling 2019-06-01 16:54:15 -03:00
2c7cf356b3 scanner: add basic tokens and matched-tokens 2019-06-01 16:51:02 -03:00
6b9cc575d9 add draft scanner, remove messy Token union, replace by struct 2019-06-01 16:37:24 -03:00
63045e4df5 add src/new_scanner.zig 2019-06-01 16:21:36 -03:00
b80cd52c50 main: readd runPrompt and runFile
- main: make run() use the VM struct instance
2019-06-01 16:17:28 -03:00
a9dca436bd remove chunk running code, add draft compiler struct 2019-06-01 16:12:39 -03:00
088674bf0b vm: add dynamically-sized growing stack 2019-06-01 15:45:30 -03:00
3377d1675c vm, chunk: add binary operators 2019-06-01 15:40:18 -03:00
2822676707 vm: add negate opcode 2019-06-01 15:27:19 -03:00
61e463713c vm: add stack 2019-06-01 15:23:23 -03:00
456bc95138 vm: add debug flags 2019-06-01 15:01:39 -03:00
dae3c259fd add basic virtual machine code 2019-06-01 14:55:11 -03:00
14fa63e1f6 finish impl for ConstantLong 2019-06-01 14:18:44 -03:00
2d33e03efb add incomplete ConstantLong instruction
- move ValueList's count to usize for ConstantLong
2019-06-01 02:06:23 -03:00
ba78b39300 add constant values to the virtual machine 2019-06-01 01:46:01 -03:00
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
6ff75a0926 finish make_exprs.py script
- add src/expr.zig
2019-05-31 23:43:46 -03:00
756f85d77d add multiline block comments 2019-05-31 22:45:23 -03:00
bba969922f add reading of keywords on doIdentifier 2019-05-31 22:39:53 -03:00
9d4c1249b4 add keyword map when scanner is initialized
- add basic identifier reading
2019-05-31 22:34:10 -03:00
69aa7b493d add number tokens 2019-05-31 22:08:41 -03:00
d1db7a0bd9 add consumption of comments and strings 2019-05-31 21:46:18 -03:00
9a2c50a53e add basic tokens and a basic lexer 2019-05-31 21:23:51 -03:00
31b0fa783c add file reads and main prompt 2019-05-31 17:07:08 -03:00
b3ea9637bd move to zig 2019-05-31 16:15:27 -03:00
05c2563c7f remove c source 2019-03-08 18:47:00 -03:00
b3ac29fd3b add some stuff
i am a reasonable human being
2019-03-08 05:22:52 -03:00