mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-22 22:02:00 +01:00
Emit a proper parse error for = with no RHS in a function (#1071)
Closes #1050
This commit is contained in:
parent
26ed30bc54
commit
197c6dbbde
@ -1,3 +1,7 @@
|
||||
## 1.27.1
|
||||
|
||||
* Emit a proper parse error for a `=` with no right-hand side in a function.
|
||||
|
||||
## 1.27.0
|
||||
|
||||
* Adds an overload to `map.merge()` that supports merging a nested map.
|
||||
|
@ -1640,8 +1640,6 @@ relase. For details, see http://bit.ly/moz-document.
|
||||
|
||||
List<Expression> commaExpressions;
|
||||
|
||||
Expression singleEqualsOperand;
|
||||
|
||||
List<Expression> spaceExpressions;
|
||||
|
||||
// Operators whose right-hand operands are not fully parsed yet, in order of
|
||||
@ -1718,7 +1716,9 @@ relase. For details, see http://bit.ly/moz-document.
|
||||
}
|
||||
|
||||
void addOperator(BinaryOperator operator) {
|
||||
if (plainCss && operator != BinaryOperator.dividedBy) {
|
||||
if (plainCss &&
|
||||
operator != BinaryOperator.dividedBy &&
|
||||
operator != BinaryOperator.singleEquals) {
|
||||
scanner.error("Operators aren't allowed in plain CSS.",
|
||||
position: scanner.position - operator.operator.length,
|
||||
length: operator.operator.length);
|
||||
@ -1750,12 +1750,6 @@ relase. For details, see http://bit.ly/moz-document.
|
||||
ListExpression(spaceExpressions, ListSeparator.space);
|
||||
spaceExpressions = null;
|
||||
}
|
||||
|
||||
if (singleEqualsOperand != null) {
|
||||
singleExpression = BinaryOperationExpression(
|
||||
BinaryOperator.singleEquals, singleEqualsOperand, singleExpression);
|
||||
singleEqualsOperand = null;
|
||||
}
|
||||
}
|
||||
|
||||
loop:
|
||||
@ -1794,9 +1788,7 @@ relase. For details, see http://bit.ly/moz-document.
|
||||
case $equal:
|
||||
scanner.readChar();
|
||||
if (singleEquals && scanner.peekChar() != $equal) {
|
||||
resolveSpaceExpressions();
|
||||
singleEqualsOperand = singleExpression;
|
||||
singleExpression = null;
|
||||
addOperator(BinaryOperator.singleEquals);
|
||||
} else {
|
||||
scanner.expectChar($equal);
|
||||
addOperator(BinaryOperator.equals);
|
||||
@ -2014,9 +2006,7 @@ relase. For details, see http://bit.ly/moz-document.
|
||||
return ListExpression(commaExpressions, ListSeparator.comma,
|
||||
brackets: bracketList,
|
||||
span: bracketList ? scanner.spanFrom(beforeBracket) : null);
|
||||
} else if (bracketList &&
|
||||
spaceExpressions != null &&
|
||||
singleEqualsOperand == null) {
|
||||
} else if (bracketList && spaceExpressions != null) {
|
||||
resolveOperations();
|
||||
return ListExpression(
|
||||
spaceExpressions..add(singleExpression), ListSeparator.space,
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: sass
|
||||
version: 1.27.0
|
||||
version: 1.27.1-dev
|
||||
description: A Sass implementation in Dart.
|
||||
author: Sass Team
|
||||
homepage: https://github.com/sass/dart-sass
|
||||
|
Loading…
x
Reference in New Issue
Block a user