mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-27 04:34:59 +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.
|
||||
|
||||
* Support `&` followed by a non-identifier.
|
||||
|
||||
## 1.0.0-alpha.8
|
||||
|
||||
* Add the `content-exists()` function.
|
||||
|
@ -103,6 +103,20 @@ abstract class Parser {
|
||||
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) {
|
||||
var next = scanner.peekChar();
|
||||
if (next == null) {
|
||||
@ -120,8 +134,6 @@ abstract class Parser {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return text.toString();
|
||||
}
|
||||
|
||||
/// Consumes a plain CSS string.
|
||||
|
@ -263,7 +263,7 @@ class SelectorParser extends Parser {
|
||||
/// Consumes a parent selector.
|
||||
ParentSelector _parentSelector() {
|
||||
scanner.expectChar($ampersand);
|
||||
var suffix = lookingAtIdentifierBody() ? identifier() : null;
|
||||
var suffix = lookingAtIdentifierBody() ? identifierBody() : null;
|
||||
return new ParentSelector(suffix: suffix);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user