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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « lib/src/css_printer.dart ('k') | lib/src/tree_printer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of csslib.visitor; 5 part of csslib.visitor;
6 6
7 ///////////////////////////////////////////////////////////////////////// 7 /////////////////////////////////////////////////////////////////////////
8 // CSS specific types: 8 // CSS specific types:
9 ///////////////////////////////////////////////////////////////////////// 9 /////////////////////////////////////////////////////////////////////////
10 10
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 class Negation extends TreeNode { 39 class Negation extends TreeNode {
40 Negation(SourceSpan span) : super(span); 40 Negation(SourceSpan span) : super(span);
41 Negation clone() => new Negation(span); 41 Negation clone() => new Negation(span);
42 visit(VisitorBase visitor) => visitor.visitNegation(this); 42 visit(VisitorBase visitor) => visitor.visitNegation(this);
43 43
44 String get name => 'not'; 44 String get name => 'not';
45 } 45 }
46 46
47 // calc(...)
48 // TODO(terry): Hack to handle calc however the expressions should be fully
49 // parsed and in the AST.
50 class CalcTerm extends LiteralTerm {
51 final LiteralTerm expr;
52
53 CalcTerm(var value, String t, this.expr, SourceSpan span)
54 : super(value, t, span);
55
56 CalcTerm clone() => new CalcTerm(value, text, expr.clone(), span);
57 visit(VisitorBase visitor) => visitor.visitCalcTerm(this);
58
59 String toString() => "$text($expr)";
60 }
61
47 // /* .... */ 62 // /* .... */
48 class CssComment extends TreeNode { 63 class CssComment extends TreeNode {
49 final String comment; 64 final String comment;
50 65
51 CssComment(this.comment, SourceSpan span) : super(span); 66 CssComment(this.comment, SourceSpan span) : super(span);
52 CssComment clone() => new CssComment(comment, span); 67 CssComment clone() => new CssComment(comment, span);
53 visit(VisitorBase visitor) => visitor.visitCssComment(this); 68 visit(VisitorBase visitor) => visitor.visitCssComment(this);
54 } 69 }
55 70
56 // CDO/CDC (Comment Definition Open <!-- and Comment Definition Close -->). 71 // CDO/CDC (Comment Definition Open <!-- and Comment Definition Close -->).
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 1434
1420 PaddingExpression._merge( 1435 PaddingExpression._merge(
1421 PaddingExpression x, PaddingExpression y, SourceSpan span) 1436 PaddingExpression x, PaddingExpression y, SourceSpan span)
1422 : super(DartStyleExpression.paddingStyle, span, 1437 : super(DartStyleExpression.paddingStyle, span,
1423 new BoxEdge.merge(x.box, y.box)); 1438 new BoxEdge.merge(x.box, y.box));
1424 1439
1425 PaddingExpression clone() => new PaddingExpression(span, 1440 PaddingExpression clone() => new PaddingExpression(span,
1426 top: box.top, right: box.right, bottom: box.bottom, left: box.left); 1441 top: box.top, right: box.right, bottom: box.bottom, left: box.left);
1427 visit(VisitorBase visitor) => visitor.visitPaddingExpression(this); 1442 visit(VisitorBase visitor) => visitor.visitPaddingExpression(this);
1428 } 1443 }
OLDNEW
« 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