mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-26 20:24:42 +01:00
declarationValue()
This commit is contained in:
parent
0b6e7669ec
commit
fcb0b7d29e
@ -14,8 +14,11 @@ class InterpolationExpression implements Expression {
|
||||
/// If this contains no interpolation, returns the plain text it contains.
|
||||
///
|
||||
/// Otherwise, returns `null`.
|
||||
String get asPlain =>
|
||||
contents.length == 1 && contents.first is String ? contents.first : null;
|
||||
String get asPlain {
|
||||
if (contents.isEmpty) return '';
|
||||
if (contents.length == 1 && contents.first is String) return contents.first;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Returns the plain text before the interpolation, or the empty string.
|
||||
String get initialPlain => contents.first is String ? contents.first : '';
|
||||
|
@ -132,11 +132,18 @@ class Parser {
|
||||
return children;
|
||||
}
|
||||
|
||||
Expression _declarationValue() {
|
||||
if (_scanner.peekChar() == $lbrace) {
|
||||
return new StringExpression([], span: _scanner.emptySpan);
|
||||
}
|
||||
|
||||
// TODO: parse static values specially?
|
||||
return _expression();
|
||||
}
|
||||
|
||||
AstNode _customPropertyDeclaration(InterpolationExpression name) =>
|
||||
throw new UnimplementedError();
|
||||
|
||||
Expression _declarationValue() => throw new UnimplementedError();
|
||||
|
||||
/// Parses a [DeclarationNode] or a [StyleRuleNode].
|
||||
///
|
||||
/// When parsing the contents of a style rule, it can be difficult to tell
|
||||
|
Loading…
Reference in New Issue
Block a user