allow multiline comments in functions
This commit is contained in:
parent
a79c62c2fa
commit
9c2d1200f7
@ -232,7 +232,11 @@ impl<'a> Parser<'a> {
|
|||||||
self.whitespace();
|
self.whitespace();
|
||||||
match comment.node {
|
match comment.node {
|
||||||
Comment::Silent => continue,
|
Comment::Silent => continue,
|
||||||
Comment::Loud(s) => stmts.push(Stmt::Comment(s)),
|
Comment::Loud(s) => {
|
||||||
|
if !self.flags.in_function() {
|
||||||
|
stmts.push(Stmt::Comment(s));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'\u{0}'..='\u{8}' | '\u{b}'..='\u{1f}' => {
|
'\u{0}'..='\u{8}' | '\u{b}'..='\u{1f}' => {
|
||||||
|
@ -318,3 +318,15 @@ error!(
|
|||||||
}",
|
}",
|
||||||
"Error: Functions can only contain variable declarations and control directives."
|
"Error: Functions can only contain variable declarations and control directives."
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
allows_multiline_comment,
|
||||||
|
"@function foo($a) {
|
||||||
|
/* foo */
|
||||||
|
@return $a;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: foo(nul);
|
||||||
|
}",
|
||||||
|
"a {\n color: nul;\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user