| OLD | NEW |
| 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 js; | 5 part of js; |
| 6 | 6 |
| 7 abstract class NodeVisitor<T> { | 7 abstract class NodeVisitor<T> { |
| 8 T visitProgram(Program node); | 8 T visitProgram(Program node); |
| 9 | 9 |
| 10 T visitBlock(Block node); | 10 T visitBlock(Block node); |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 if (expression == null) { | 474 if (expression == null) { |
| 475 arguments = <Expression>[]; | 475 arguments = <Expression>[]; |
| 476 } else if (expression is List) { | 476 } else if (expression is List) { |
| 477 arguments = expression.map(js.toExpression).toList(); | 477 arguments = expression.map(js.toExpression).toList(); |
| 478 } else { | 478 } else { |
| 479 arguments = <Expression>[js.toExpression(expression)]; | 479 arguments = <Expression>[js.toExpression(expression)]; |
| 480 } | 480 } |
| 481 return callWith(arguments); | 481 return callWith(arguments); |
| 482 } | 482 } |
| 483 | 483 |
| 484 Expression equals(expression) => binary('==', expression); | |
| 485 | |
| 486 Expression strictEquals(expression) => binary('===', expression); | |
| 487 | |
| 488 Expression notEquals(expression) => binary('!=', expression); | |
| 489 | |
| 490 Expression operator +(expression) => binary('+', expression); | 484 Expression operator +(expression) => binary('+', expression); |
| 491 | 485 |
| 492 Expression operator -(expression) => binary('-', expression); | 486 Expression operator -(expression) => binary('-', expression); |
| 493 | 487 |
| 494 Expression operator &(expression) => binary('&', expression); | 488 Expression operator &(expression) => binary('&', expression); |
| 495 | 489 |
| 496 Expression operator <(expression) => binary('<', expression); | 490 Expression operator <(expression) => binary('<', expression); |
| 497 | 491 |
| 498 Expression operator >(expression) => binary('>', expression); | 492 Expression operator >(expression) => binary('>', expression); |
| 499 | 493 |
| 500 Expression operator >=(expression) => binary('>=', expression); | 494 Expression operator >=(expression) => binary('>=', expression); |
| 501 | 495 |
| 502 Expression binary(String operator, expression) { | 496 Expression binary(String operator, expression) { |
| 503 return new Binary(operator, this, js.toExpression(expression)); | 497 return new Binary(operator, this, js.toExpression(expression)); |
| 504 } | 498 } |
| 505 | 499 |
| 506 Expression assign(expression) { | |
| 507 return new Assignment(this, js.toExpression(expression)); | |
| 508 } | |
| 509 | |
| 510 Expression update(String operator, expression) { | 500 Expression update(String operator, expression) { |
| 511 return new Assignment.compound(this, operator, js.toExpression(expression)); | 501 return new Assignment.compound(this, operator, js.toExpression(expression)); |
| 512 } | 502 } |
| 513 | 503 |
| 514 Expression get plusPlus => new Postfix('++', this); | 504 Expression get plusPlus => new Postfix('++', this); |
| 515 | 505 |
| 516 Prefix get typeof => new Prefix('typeof', this); | 506 Prefix get typeof => new Prefix('typeof', this); |
| 517 | 507 |
| 518 Prefix get not => new Prefix('!', this); | 508 Prefix get not => new Prefix('!', this); |
| 519 } | 509 } |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 */ | 1006 */ |
| 1017 class Comment extends Statement { | 1007 class Comment extends Statement { |
| 1018 final String comment; | 1008 final String comment; |
| 1019 | 1009 |
| 1020 Comment(this.comment); | 1010 Comment(this.comment); |
| 1021 | 1011 |
| 1022 accept(NodeVisitor visitor) => visitor.visitComment(this); | 1012 accept(NodeVisitor visitor) => visitor.visitComment(this); |
| 1023 | 1013 |
| 1024 void visitChildren(NodeVisitor visitor) {} | 1014 void visitChildren(NodeVisitor visitor) {} |
| 1025 } | 1015 } |
| OLD | NEW |