about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/errors.rs
AgeCommit message (Collapse)AuthorFilesLines
2021-02-28 r/2251 refactor(tazjin/rlox): Represent VM values as enumsVincent Ambo1-0/+1
Introduces a new enum which represents the different types of possible values, and modifies the rest of the existing code to wrap/unwrap these enum variants correctly. Notably in the vm module, a new macro has been introduced that makes it possible to encode a type expectation and return a runtime error in case of a type mismatch. Change-Id: I325b5e31e395c62d8819ab2af6d398e1277333c0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2570 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2021-02-27 r/2237 feat(tazjin/rlox): Bootstrap rough shape of bytecode compilerVincent Ambo1-0/+1
This one necessarily has to diverge more from the book than the treewalk interpreter did, so some of this is expected to change, but I'm happy with the rough shape. Since we're reusing the old scanner, the compiler/parser struct owns an iterator over all tokens with which the pull-scanner from the bytecode chapters is simulated. Change-Id: Icfa0bd4729d9df786e08f7e49a25cba1b9989a91 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2556 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2021-02-27 r/2236 chore(tazjin/rlox): Add From<Error> for Vec<Error>Vincent Ambo1-0/+8
This makes it easier to transition between the single/multi error functions via ? Change-Id: Ie027f4700da463a549be6f0d4a0022a9b8dc0d61 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2555 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2021-02-27 r/2234 chore(tazjin/rlox): Implement From<ScannerError> for bytecode errorsVincent Ambo1-2/+21
Change-Id: I446c6e38cf239a132882d37df156884d319ca111 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2553 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2021-01-18 r/2129 refactor(tazjin/rlox): Add Interpreter trait for switching implsVincent Ambo1-0/+8
Change-Id: Iae28d64ce879014c5e5d7e145c536c1f16ad307d Reviewed-on: https://cl.tvl.fyi/c/depot/+/2418 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2021-01-17 r/2127 feat(tazjin/rlox): Bootstrap VM for Lox bytecodeVincent Ambo1-0/+13
Change-Id: I479e20bf2087e5c4aa20e31b364c57ed0d961bcf Reviewed-on: https://cl.tvl.fyi/c/depot/+/2416 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>