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

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: Update CHANGELOG.md 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
« no previous file with comments | « lib/src/css_printer.dart ('k') | lib/src/tree_printer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/tree.dart
diff --git a/lib/src/tree.dart b/lib/src/tree.dart
index 75e962900085a6f953f4e4bbd8263d184d47391b..ba8370e96b1b1a65acb8fcca5de95fb3a2d047ac 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() => "$text($expr)";
+}
+
// /* .... */
class CssComment extends TreeNode {
final String comment;
« no previous file with comments | « lib/src/css_printer.dart ('k') | lib/src/tree_printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698