!global
variables declared inside control flow not at root do not also add variable to current scope
This commit is contained in:
parent
6630a1c2ea
commit
6debd2ef52
@ -105,12 +105,8 @@ impl<'a> Parser<'a> {
|
||||
} else {
|
||||
self.global_scope.insert_var(ident, value);
|
||||
}
|
||||
} else {
|
||||
if self.flags.in_control_flow() && global {
|
||||
self.scopes.insert_var_last(ident, value);
|
||||
} else {
|
||||
self.scopes.insert_var(ident, value);
|
||||
}
|
||||
} else if !(self.flags.in_control_flow() && global) {
|
||||
self.scopes.insert_var(ident, value);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -289,6 +289,23 @@ test!(
|
||||
}",
|
||||
"a {\n color: c;\n}\n"
|
||||
);
|
||||
test!(
|
||||
inside_style_inside_control_flow_declared_outer_global_comes_prior,
|
||||
"$a: a;
|
||||
|
||||
a {
|
||||
$a: b;
|
||||
|
||||
@if true {
|
||||
$a: c !global;
|
||||
color: $a;
|
||||
$a: e;
|
||||
}
|
||||
|
||||
color: $a;
|
||||
}",
|
||||
"a {\n color: b;\n color: e;\n}\n"
|
||||
);
|
||||
// https://github.com/Kixiron/lasso/issues/7
|
||||
test!(
|
||||
regression_test_for_lasso_0_3_0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user