about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/resolver.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-01-17T08·59+0300
committertazjin <mail@tazj.in>2021-01-17T09·34+0000
commit06a6aa5dc08ffff2ba82af2254256ea60c6a5bec (patch)
tree255922aa98b3dda00a2f941159bb71400cac27aa /users/tazjin/rlox/src/resolver.rs
parent9ea76fdf1ac08cd9b594ad37f6b963e78f818efc (diff)
refactor(tazjin/rlox): Call resolver from interpreter r/2118
This makes the interpreter API a bit cleaner and allows for tighter
integration between the two parts (e.g. for static globals, which are
unhandled in the resolver right now).

Change-Id: I363714dc2e13cefa7731b54326573e0b871295d6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2407
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/rlox/src/resolver.rs')
-rw-r--r--users/tazjin/rlox/src/resolver.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/users/tazjin/rlox/src/resolver.rs b/users/tazjin/rlox/src/resolver.rs
index f5ef91b99a19..03ac3c8e6794 100644
--- a/users/tazjin/rlox/src/resolver.rs
+++ b/users/tazjin/rlox/src/resolver.rs
@@ -186,8 +186,7 @@ impl<'a> Resolver<'a> {
     }
 }
 
-pub fn resolve(mut block: parser::Block) -> Result<parser::Block, Error> {
+pub fn resolve(block: &mut parser::Block) -> Result<(), Error> {
     let mut resolver: Resolver = Default::default();
-    resolver.resolve(&mut block)?;
-    Ok(block)
+    resolver.resolve(block)
 }