diff options
author | Vincent Ambo <mail@tazj.in> | 2021-03-05T20·35+0200 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2021-03-06T11·52+0000 |
commit | 4162186a1963b0dcf3dc47946a1cd8ad81467ac4 (patch) | |
tree | 01dac61eeee9362d3e71c2a1e966da0b01180bfc /users/tazjin/rlox/src/bytecode/opcode.rs | |
parent | 29b2a547055ba1adaf3f0d79055b7d7657eb3a5e (diff) |
feat(tazjin/rlox): Implement global variable access r/2274
This also includes a fix for an issue where the identifiers of variables were pushed onto the stack, which is incorrect. Change-Id: Id89b388268efad295f29978d767aa4b33c4ded14 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2594 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/rlox/src/bytecode/opcode.rs')
-rw-r--r-- | users/tazjin/rlox/src/bytecode/opcode.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/users/tazjin/rlox/src/bytecode/opcode.rs b/users/tazjin/rlox/src/bytecode/opcode.rs index 25ce03c3c182..1c23449e76b3 100644 --- a/users/tazjin/rlox/src/bytecode/opcode.rs +++ b/users/tazjin/rlox/src/bytecode/opcode.rs @@ -30,6 +30,7 @@ pub enum OpCode { OpPrint, OpPop, - // Variable definitions + // Variable management OpDefineGlobal(usize), + OpGetGlobal(usize), } |