about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/tests.rs
AgeCommit message (Collapse)AuthorFilesLines
2021-02-28 r/2255 feat(tazjin/rlox): Implement equality operatorVincent Ambo1-5/+26
Change-Id: I5587a11646e228c5af4dc7ca6da026bb4a2592a6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2574 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2021-02-28 r/2253 feat(tazjin/rlox): Implement unary negation operatorVincent Ambo1-0/+9
Change-Id: I9a5bd3581d4ed05371651697ec496341eb7971ae Reviewed-on: https://cl.tvl.fyi/c/depot/+/2572 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2021-02-28 r/2252 feat(tazjin/rlox): Support trivial literals in bytecode compilerVincent Ambo1-2/+14
Adds support for true, false & nil. These each come with a new separate opcode and are pushed directly on the stack. Change-Id: I405b5b09496dcf99d514d3411c083e0834377167 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2571 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2021-02-28 r/2251 refactor(tazjin/rlox): Represent VM values as enumsVincent Ambo1-19/+19
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-28 r/2250 test(tazjin/rlox): Add some tests for numerical operationsVincent Ambo1-0/+48
If I was adding any dependencies, this might be a good one for a property-based test thing, but I'm not going to. Change-Id: Ia801d041479d1a88c59ef9e0fe1460b3640382e3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2569 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI