From 27a9578b17a8ed8227cb190af38762111edae58f Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Tue, 24 Mar 2020 00:26:55 -0400 Subject: [PATCH] check global scope for variable before local --- src/scope.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/scope.rs b/src/scope.rs index 068b52a..fbb5192 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -56,9 +56,12 @@ impl Scope { pub fn get_var(&self, v: &str) -> SassResult { let name = &v.replace('_', "-"); - match self.vars.get(name) { - Some(v) => Ok(v.clone()), - None => get_global_var(name), + match get_global_var(name) { + Ok(v) => Ok(v), + Err(e) => match self.vars.get(name) { + Some(v) => Ok(v.clone()), + None => Err(e) + } } }