e1a8717d21
updated tests for functions
2024-08-28 17:29:54 +02:00
b717b91ee5
implemented function calls
2024-08-28 17:29:36 +02:00
0dc19b4fdf
automatically include loxstd in default env
2024-08-28 17:28:07 +02:00
1e50140970
fixed oeprator not to convert to bool first
2024-08-28 17:24:19 +02:00
8735cc5023
in environment made globals ref to easier share
2024-08-28 17:21:36 +02:00
8f4b95a137
added loxstd with clock and exit
2024-08-28 17:19:34 +02:00
65a130deb8
added function values
2024-08-28 17:17:17 +02:00
9fcb89460d
removed print in call
2024-08-28 00:12:58 +02:00
99e5313308
updated call test
2024-08-27 23:51:14 +02:00
2643b16f72
changed all names from MlLox to mlox
2024-08-27 23:30:40 +02:00
be931b7214
implemented calls
2024-08-27 20:32:05 +02:00
8d445cc9e4
changed tokens from mutable to ref
...
so that when record is copied it's still the same field
2024-08-27 19:00:11 +02:00
54dc78f0b8
added tests for break and continue
2024-08-27 18:59:34 +02:00
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