disallow interpolation in the name of mixin declarations

This commit is contained in:
Connor Skees 2020-07-15 13:20:50 -04:00
parent 1307005639
commit f8453e4a0a
2 changed files with 12 additions and 1 deletions

View File

@ -17,7 +17,7 @@ use super::{common::ContextFlags, Parser, Stmt};
impl<'a> Parser<'a> {
pub(super) fn parse_mixin(&mut self) -> SassResult<()> {
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() {
return Err(("Mixins may not contain mixin declarations.", span).into());

View File

@ -478,3 +478,14 @@ error!(
}",
"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 \"{\"."
);