Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // TODO(asgerf): Include metadata. | 5 // TODO(asgerf): Include metadata. |
| 6 // TODO(asgerf): Include cascade operator. | 6 // TODO(asgerf): Include cascade operator. |
| 7 library dart_printer; | 7 library dart_printer; |
| 8 | 8 |
| 9 import '../dart2jslib.dart' as dart2js; | 9 import '../dart2jslib.dart' as dart2js; |
| 10 import '../tree/tree.dart' as tree; | 10 import '../tree/tree.dart' as tree; |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 537 Throw(this.expression); | 537 Throw(this.expression); |
| 538 } | 538 } |
| 539 | 539 |
| 540 class This extends Expression { | 540 class This extends Expression { |
| 541 static final This _instance = new This._create(); | 541 static final This _instance = new This._create(); |
| 542 | 542 |
| 543 factory This() => _instance; | 543 factory This() => _instance; |
| 544 This._create(); | 544 This._create(); |
| 545 } | 545 } |
| 546 | 546 |
| 547 class Super extends Expression { | |
|
asgerf
2014/06/23 10:55:17
There is already a SuperReceiver class for this.
sigurdm
2014/06/24 09:23:08
Thanks - don't know why I could not find it.
| |
| 548 static final Super _instance = new Super._create(); | |
| 549 | |
| 550 factory Super() => _instance; | |
| 551 Super._create(); | |
| 552 } | |
| 553 | |
| 547 // UNPARSER | 554 // UNPARSER |
| 548 | 555 |
| 549 bool isUnaryOperator(String op) { | 556 bool isUnaryOperator(String op) { |
| 550 return op == '!' || op == '-' || op == '~'; | 557 return op == '!' || op == '-' || op == '~'; |
| 551 } | 558 } |
| 552 bool isBinaryOperator(String op) { | 559 bool isBinaryOperator(String op) { |
| 553 return BINARY_PRECEDENCE.containsKey(op); | 560 return BINARY_PRECEDENCE.containsKey(op); |
| 554 } | 561 } |
| 555 /// True if the given operator can be converted to a compound assignment. | 562 /// True if the given operator can be converted to a compound assignment. |
| 556 bool isCompoundableOperator(String op) { | 563 bool isCompoundableOperator(String op) { |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1501 final StringChunk previous; | 1508 final StringChunk previous; |
| 1502 final tree.StringQuoting quoting; | 1509 final tree.StringQuoting quoting; |
| 1503 num cost; | 1510 num cost; |
| 1504 | 1511 |
| 1505 OpenStringChunk(this.previous, this.quoting, this.cost); | 1512 OpenStringChunk(this.previous, this.quoting, this.cost); |
| 1506 | 1513 |
| 1507 StringChunk end(int endIndex) { | 1514 StringChunk end(int endIndex) { |
| 1508 return new StringChunk(previous, quoting, endIndex); | 1515 return new StringChunk(previous, quoting, endIndex); |
| 1509 } | 1516 } |
| 1510 } | 1517 } |
| OLD | NEW |