feat(tazjin/rlox): Implement global variable access

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
This commit is contained in:
Vincent Ambo 2021-03-05 22:35:02 +02:00 committed by tazjin
parent 29b2a54705
commit 4162186a19
4 changed files with 48 additions and 6 deletions

View file

@ -30,6 +30,7 @@ pub enum OpCode {
OpPrint,
OpPop,
// Variable definitions
// Variable management
OpDefineGlobal(usize),
OpGetGlobal(usize),
}