about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/interpreter
AgeCommit message (Collapse)AuthorFilesLines
2021-01-14 r/2104 refactor(tazjin/rlox): Thread lifetimes through interpreterVincent Ambo1-8/+17
In order to store a function in the interpreter's representation of a callable, the lifetimes used throughout rlox need to be threaded through properly. This is currently not optimal, for two reasons: * following the design of the book's scanner, the source code slice needs to still be available at runtime. Rust makes this explicit, but it seems unnecessary. * the interpreter's lifetime is now bounded to be smaller than the source's, which means that the REPL no longer persists state between evaluations Both of these can be fixed eventually by diverging the scanner from the book slightly, but right now that's not my priority. Change-Id: Id0bf694541ff59795cfdea3c64a965384a49bfe2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2391 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2021-01-14 r/2100 test(tazjin/rlox): Add a handful of interpreter testsVincent Ambo1-0/+63
Change-Id: I32dd896d42cc73d68d73093e9cbb74b48d95e041 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2386 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2021-01-14 r/2095 feat(tazjin/rlox): Scaffolding for builtin functionsVincent Ambo1-0/+25
... and adds an example builtin which returns the current epoch. The types introduced by this, especially in the interpreter module, are going to be used for user-defined functions, too. Change-Id: I0364a67241e94642cde08489ac711a340e30ebe8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2381 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI