mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-27 12:44:42 +01:00
Support &1.
This commit is contained in:
parent
b695fa6461
commit
015bb0d79f
@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
* Always parse imports with queries as plain CSS imports.
|
* Always parse imports with queries as plain CSS imports.
|
||||||
|
|
||||||
|
* Support `&` followed by a non-identifier.
|
||||||
|
|
||||||
## 1.0.0-alpha.8
|
## 1.0.0-alpha.8
|
||||||
|
|
||||||
* Add the `content-exists()` function.
|
* Add the `content-exists()` function.
|
||||||
|
@ -103,6 +103,20 @@ abstract class Parser {
|
|||||||
scanner.error("Expected identifier.");
|
scanner.error("Expected identifier.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_identifierBody(text, unit: unit);
|
||||||
|
return text.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Consumes a chunk of a plain CSS identifier after the name start.
|
||||||
|
String identifierBody() {
|
||||||
|
var text = new StringBuffer();
|
||||||
|
_identifierBody(text);
|
||||||
|
if (text.isEmpty) scanner.error("expected identifier body.");
|
||||||
|
return text.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Like [_identifierBody], but parses the body into the [text] buffer.
|
||||||
|
void _identifierBody(StringBuffer text, {bool unit: false}) {
|
||||||
while (true) {
|
while (true) {
|
||||||
var next = scanner.peekChar();
|
var next = scanner.peekChar();
|
||||||
if (next == null) {
|
if (next == null) {
|
||||||
@ -120,8 +134,6 @@ abstract class Parser {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return text.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Consumes a plain CSS string.
|
/// Consumes a plain CSS string.
|
||||||
|
@ -263,7 +263,7 @@ class SelectorParser extends Parser {
|
|||||||
/// Consumes a parent selector.
|
/// Consumes a parent selector.
|
||||||
ParentSelector _parentSelector() {
|
ParentSelector _parentSelector() {
|
||||||
scanner.expectChar($ampersand);
|
scanner.expectChar($ampersand);
|
||||||
var suffix = lookingAtIdentifierBody() ? identifier() : null;
|
var suffix = lookingAtIdentifierBody() ? identifierBody() : null;
|
||||||
return new ParentSelector(suffix: suffix);
|
return new ParentSelector(suffix: suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user