Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Unified Diff: lib/src/tree.dart

Issue 1407333002: Added beginning support for calc however, the expression is not fully parsed into the AST. (Closed) Base URL: https://github.com/dart-lang/csslib.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/src/tree.dart
diff --git a/lib/src/tree.dart b/lib/src/tree.dart
index 75e962900085a6f953f4e4bbd8263d184d47391b..b8438bbfb70043f9c87aa15ccefe2a767d720fae 100644
--- a/lib/src/tree.dart
+++ b/lib/src/tree.dart
@@ -44,6 +44,21 @@ class Negation extends TreeNode {
String get name => 'not';
}
+// calc(...)
+// TODO(terry): Hack to handle calc however the expressions should be fully
+// parsed and in the AST.
+class CalcTerm extends LiteralTerm {
+ final LiteralTerm expr;
+
+ CalcTerm(var value, String t, this.expr, SourceSpan span)
+ : super(value, t, span);
+
+ CalcTerm clone() => new CalcTerm(value, text, expr.clone(), span);
+ visit(VisitorBase visitor) => visitor.visitCalcTerm(this);
+
+ String toString() => "$t($expr)";
kevmoo 2015/10/16 17:56:39 Where is `t` coming from? you mean `$text`?
terry 2015/10/16 18:28:47 Done.
+}
+
// /* .... */
class CssComment extends TreeNode {
final String comment;

Powered by Google App Engine
This is Rietveld 408576698