Age | Commit message (Collapse) | Author | Files | Lines |
|
It's unclear if the second part of the book can reuse anything from
the first part (I'm guessing probably the scanner, but I'll move that
back if it turns out to be the case).
Change-Id: I9411355929e31ac6e953599e51665406b1f48d55
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2415
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Implements the first part of the resolver from
https://craftinginterpreters.com/resolving-and-binding.html
This is wired up to the execution paths in main, but not yet in the
tests. The resolved depth is also not actually used for variable
lookups (yet).
Change-Id: I3a8615252b7b9b12d5a290c5ddf85988f61b9184
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2403
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
In the book this is implemented via exceptions as control flow, and
I'm sticking somewhat closely to that by doing it via an error
variant.
Change-Id: I9c7b84d6bb28265ab94021ea681df84f16a53da2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2395
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
This removes the runtime dependency on a borrow into the program
source code.
It's not yet ideal because there are a lot of tokens where we really
don't care about the lexeme, but this is what the book does and I
am not going to change that.
Change-Id: I888e18f98597766d6f725cbf9241e8eb2bd839e2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2394
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
... with this, functions now work.
Note that this bubbled up another weird code structure nit: The
parser::Function type should probably not carry its name directly.
However this doesn't matter much and I don't care right now.
Change-Id: If8e3b23f07033260433b9acd45f37c0e61fd2ff8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2393
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I1db4316563827976e5233dc7a626968f80b992ef
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2390
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I9a45f823f16919319d6135225d5bd53ed54c2530
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2388
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
This is much easier to read & write. It's been annoying me all the way
through.
Change-Id: Ia91756d3111a2ce3f74e1c14bccc210118d221dd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2387
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I1836c73dbfd5fc4ca30c2d22bbffee2fb222d566
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2366
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I31a93efcc8e0c2bcb8549e2a2c05bb58d2dc74ca
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2326
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: Iee772274de95dfd6a6d4af973402859aeda17b1d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2325
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I1a7d0eda61f7f077b820dc0d2c2516e204966962
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2324
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I2352d75a3f02d65a5a2d04fb2cc4daa50f11ca1e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2321
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
|
|
Change-Id: I1b7235ed71fa36120984a36f22cd564f59581352
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2303
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I6f21b246eb9d3bf760edb3220ce6be5de5b05b08
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2302
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I56db10a5ac26958ae27a8d4c8fa7b8f8285bc7e1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2299
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I9894d76716d739e85a4757d9e658f884228e7f52
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2290
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I873fdd53319ec36da18926d9477e809a69dbace7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2288
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
First part of
https://craftinginterpreters.com/statements-and-state.html
Supports print statements, as well as evaluation for the sake of
it (i.e. future side-effects).
Change-Id: Ic6653b568f98d6cfe3f297615b7113c0ba1d9a70
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2287
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
This is only a subset of the Lox spec so far. It implements the
language up to the runtime error chapter on
https://craftinginterpreters.com/evaluating-expressions.html
Change-Id: I295dbf4b6544420d6fe80b6aaba661fb21acdea6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2281
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
This lets the parser collect multiple errors instead of returning
after the first one, with some optimistic synchronisation after
encountering something that looks wonky.
Change-Id: Ie9d0ce8de9dcc7a3d1e7aa2abe15f74cab0ab96b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2236
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I940448c63ce105d53a0f281b6320ffb01378f207
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2235
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I0e6bd71fd787b719104ef93fc52df4090dc415b9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2234
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
Change-Id: I7ae3d721f76d8d69043f5ed077abbc70a18cbd92
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2233
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
... with the exception of parenthesised expressions, because error
threading is not implemented yet.
Change-Id: I8d455d85e647548d5b71cbfd3d078f4970dab7fb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2232
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|
|
... mostly some AST boilerplate and a first top-level rule, plus
boilerplate similar to that set up in the Scanner.
Change-Id: I605d1de23c47a3b3702ab4f62cd3371bc3988c7d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2194
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
|