Commit graph

21 commits

Author SHA1 Message Date
4eede91cfd Add the rest of the evaluator tests.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-13 19:46:10 -08:00
b68bbf01d2 Copy all parser tests.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-13 19:38:57 -08:00
fb25a86b91 Done with the book! Added hash maps and the puts builtin.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-10 21:09:44 -08:00
fa9f450278 Done with arrays and all its associated builtins
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-10 19:12:19 -08:00
59acf6b1a1 Implement strings and partial implementation of arrays (missing index expr eval)
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-10 17:48:54 -08:00
a76f47a7a3 Evaluate function literals and function calls.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-09 16:33:19 -08:00
500a058ff8 Add variable bindings and references to the evaluator.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-08 19:41:36 -08:00
8514ead895 Evaluate if and return, error validation.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-07 18:15:12 -08:00
cf8b0033c9 Introduced the evaluator (and integrated it with the REPL)
It supports integer and boolean literals, prefix expressions and infix
expressions with integer operands.

Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-06 18:24:23 -08:00
acc6707740 Add error message to the REPL
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-06 16:36:24 -08:00
44f936affb Parse call expressions and gets rid of the TODOs in parse let and return.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-05 16:59:06 -08:00
985cf24fbc Parse function literals.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-05 16:13:08 -08:00
9e9324bb56 Parse if and if else expressions.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-05 15:35:00 -08:00
5367fbd29d Move AST nodes to their own files.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-05 13:05:35 -08:00
4acc09faf9 Parsed grouped expressions (that was easy!).
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-05 11:37:13 -08:00
c417e90f36 Parsing and testing boolean literals.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-04 19:16:22 -08:00
5fa7b2481a Parses infix expressions.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-04 17:56:10 -08:00
f286a88039 Parsing identifiers, integer literals and prefix expressions (all as expression statements)
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-03 19:38:03 -08:00
577fad2da6 Parsing statements (skipping expressions).
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-02 19:46:45 -08:00
04dfd62600 Add REPL boilerplate.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-02 17:18:00 -08:00
dcf5cb336a Done with lexer (chap1)
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-01 18:35:22 -08:00