check global scope for variable before local
This commit is contained in:
parent
c29088b558
commit
27a9578b17
@ -56,9 +56,12 @@ impl Scope {
|
||||
|
||||
pub fn get_var(&self, v: &str) -> SassResult<Value> {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user