allow semicolon after closing brace
This commit is contained in:
parent
81c85a6f86
commit
c0eaf4c5f6
@ -137,7 +137,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
|
||||
f.insert(
|
||||
"get-function".to_owned(),
|
||||
Builtin::new(|mut args, scope| {
|
||||
max_args!(args, 2);
|
||||
max_args!(args, 3);
|
||||
let name = match arg!(args, 0, "name") {
|
||||
Value::Ident(s, _) => s,
|
||||
v => return Err(format!("$name: {} is not a string.", v).into()),
|
||||
|
@ -505,6 +505,10 @@ pub(crate) fn eat_expr<I: Iterator<Item = Token>>(
|
||||
if values.is_empty() {
|
||||
toks.next();
|
||||
devour_whitespace(toks);
|
||||
if toks.peek().is_some() && toks.peek().unwrap().kind == ';' {
|
||||
toks.next();
|
||||
}
|
||||
devour_whitespace(toks);
|
||||
return Ok(None);
|
||||
} else {
|
||||
// special edge case where there was no space between the colon
|
||||
|
@ -110,3 +110,8 @@ test!(
|
||||
"$base-color: #036;\na {\n color:lighten($base-color, 5%);\n}",
|
||||
"a {\n color: #004080;\n}\n"
|
||||
);
|
||||
test!(
|
||||
semicolon_after_closing_brace,
|
||||
"a {\n color: foo;\n};",
|
||||
"a {\n color: foo;\n}\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user