disallow interpolation in the name of mixin declarations
This commit is contained in:
parent
1307005639
commit
f8453e4a0a
@ -17,7 +17,7 @@ use super::{common::ContextFlags, Parser, Stmt};
|
|||||||
impl<'a> Parser<'a> {
|
impl<'a> Parser<'a> {
|
||||||
pub(super) fn parse_mixin(&mut self) -> SassResult<()> {
|
pub(super) fn parse_mixin(&mut self) -> SassResult<()> {
|
||||||
self.whitespace();
|
self.whitespace();
|
||||||
let Spanned { node: name, span } = self.parse_identifier()?;
|
let Spanned { node: name, span } = self.parse_identifier_no_interpolation(false)?;
|
||||||
|
|
||||||
if self.flags.in_mixin() {
|
if self.flags.in_mixin() {
|
||||||
return Err(("Mixins may not contain mixin declarations.", span).into());
|
return Err(("Mixins may not contain mixin declarations.", span).into());
|
||||||
|
@ -478,3 +478,14 @@ error!(
|
|||||||
}",
|
}",
|
||||||
"Error: Mixins may not be declared in control directives."
|
"Error: Mixins may not be declared in control directives."
|
||||||
);
|
);
|
||||||
|
error!(
|
||||||
|
does_not_allow_interpolation_in_name_of_declaration,
|
||||||
|
"@mixin n#{a}me {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
@include name;
|
||||||
|
}",
|
||||||
|
"Error: expected \"{\"."
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user