Commit graph

34 commits

Author SHA1 Message Date
d2077774f7 use prerr_* instead of fprintf where possible 2024-08-27 18:45:26 +02:00
e2fcb0f6ef print errors to stderr instead stdout 2024-08-27 18:42:18 +02:00
f30b0444e4 activated tests for while loop 2024-08-27 18:42:08 +02:00
461225977f added tests for for loop 2024-08-27 18:31:29 +02:00
fdf392b53f fixed scoping in For loop 2024-08-27 18:31:23 +02:00
94ccf91689 fixed bug wih with_is_in_loop 2024-08-27 18:25:12 +02:00
6206ee4a00 moved mutable part of state inside mutable field
since only `tokens` is actually mutable we can make that field mutable,
and hence not have to deal with `state ref`s, and only have a single
mutating function, i.e. `advance`.
2024-08-27 18:01:34 +02:00
be28dad67e moved for loop to separate Stmt and added continue 2024-08-27 17:15:35 +02:00
957783a926 added release profile and bytecode target for main 2024-08-27 17:14:42 +02:00
e288a626fd implemented break 2024-08-27 02:46:17 +02:00
3bc871d434 implemented while and for loops 2024-08-27 01:57:47 +02:00
6de93de529 finished test suite up to current state 2024-08-26 17:27:12 +02:00
dbcdbc216f added If, And, Or 2024-08-26 17:26:59 +02:00
77e57cd8c2 global and local variables with scope
also reworked arg parsing, now has --debug flag
2024-08-26 01:58:03 +02:00
222de81a19 print ints as ints instead of floats
i.e. no trailing dot
2024-08-26 01:57:08 +02:00
446fde29d1 updated some exptected test outputs 2024-08-25 23:19:18 +02:00
d2a9964541 filled out some dune-project info 2024-08-25 21:22:53 +02:00
29431d0cdb moved benchmark lox files to separate folder 2024-08-25 21:22:30 +02:00
b4e25ee561 fixed parser bug by filtering out all comments 2024-08-25 03:07:18 +02:00
ea0d7acbee started implementing expressions
Parser.parse now return list of statements or list of errors.
parsing continues until EOF, even when errors are found; but after the
first error the result can only be Error.
Also implemented Print and Expr statements.
2024-08-25 02:12:51 +02:00
8656ac50ed updated switch file 2024-08-18 10:33:01 +02:00
a8290a4104 moved exprs into nodes with code position 2024-08-17 13:32:59 +02:00
485ecebdf3 reworked parser error handling
now based around result; since each parsing step can emit at most one
error until synchronisation is triggered we can store the errors in the
result.

also state is now stored in a ref variable. the copy-and-update is more
pure, but really messes up the let* expression for the expr/error
results.
2024-08-14 14:15:01 +02:00
f14677b6f5 fnished first draft of expression parser 2024-08-14 12:36:36 +02:00
3bd18634d5 implemented parsing up to neg/not 2024-08-12 18:28:21 +02:00
3590a78154 more work on the parser 2024-08-12 16:31:28 +02:00
686fb195af added block comments 2024-08-04 00:33:28 +02:00
874a6f4566 added opam switch file 2024-08-03 11:23:01 +02:00
c20a9fb48e removed debug printing 2024-08-03 02:45:07 +02:00
250bdc5992 removed debug printing; exit 1 on error 2024-08-03 02:44:47 +02:00
f6b1940057 renamed binary to mlox 2024-08-03 02:44:24 +02:00
0f3d0a15f0 added lox test files 2024-08-03 02:44:12 +02:00
821f5c62bc added identifiers and keywords 2024-08-02 01:14:35 +02:00
d33023f435 init commit 2024-08-02 00:10:48 +02:00