| 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 interface Visitor<R> { | 5 interface Visitor<R> { |
| 6 R visitBlock(Block node); | 6 R visitBlock(Block node); |
| 7 R visitBreakStatement(BreakStatement node); | 7 R visitBreakStatement(BreakStatement node); |
| 8 R visitCascade(Cascade node); | 8 R visitCascade(Cascade node); |
| 9 R visitCascadeReceiver(CascadeReceiver node); | 9 R visitCascadeReceiver(CascadeReceiver node); |
| 10 R visitCaseMatch(CaseMatch node); | 10 R visitCaseMatch(CaseMatch node); |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 | 668 |
| 669 accept(Visitor visitor) => visitor.visitLiteralDouble(this); | 669 accept(Visitor visitor) => visitor.visitLiteralDouble(this); |
| 670 } | 670 } |
| 671 | 671 |
| 672 class LiteralBool extends Literal<bool> { | 672 class LiteralBool extends Literal<bool> { |
| 673 LiteralBool(Token token, DecodeErrorHandler handler) : super(token, handler); | 673 LiteralBool(Token token, DecodeErrorHandler handler) : super(token, handler); |
| 674 | 674 |
| 675 LiteralBool asLiteralBool() => this; | 675 LiteralBool asLiteralBool() => this; |
| 676 | 676 |
| 677 bool get value() { | 677 bool get value() { |
| 678 switch (token.value) { | 678 if (token.value == Keyword.TRUE) return true; |
| 679 case Keyword.TRUE: return true; | 679 if (token.value == Keyword.FALSE) return false; |
| 680 case Keyword.FALSE: return false; | 680 (this.handler)(token, "not a bool ${token.value}"); |
| 681 default: | |
| 682 (this.handler)(token, "not a bool ${token.value}"); | |
| 683 } | |
| 684 } | 681 } |
| 685 | 682 |
| 686 accept(Visitor visitor) => visitor.visitLiteralBool(this); | 683 accept(Visitor visitor) => visitor.visitLiteralBool(this); |
| 687 } | 684 } |
| 688 | 685 |
| 689 | 686 |
| 690 class StringQuoting { | 687 class StringQuoting { |
| 691 static final StringQuoting SINGLELINE_DQ = | 688 static final StringQuoting SINGLELINE_DQ = |
| 692 const StringQuoting($DQ, raw: false, leftQuoteLength: 1); | 689 const StringQuoting($DQ, raw: false, leftQuoteLength: 1); |
| 693 static final StringQuoting RAW_SINGLELINE_DQ = | 690 static final StringQuoting RAW_SINGLELINE_DQ = |
| (...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1709 * argument). | 1706 * argument). |
| 1710 * | 1707 * |
| 1711 * TODO(ahe): This method is controversial, the team needs to discuss | 1708 * TODO(ahe): This method is controversial, the team needs to discuss |
| 1712 * if top-level methods are acceptable and what naming conventions to | 1709 * if top-level methods are acceptable and what naming conventions to |
| 1713 * use. | 1710 * use. |
| 1714 */ | 1711 */ |
| 1715 initializerDo(Node node, f(Node node)) { | 1712 initializerDo(Node node, f(Node node)) { |
| 1716 SendSet send = node.asSendSet(); | 1713 SendSet send = node.asSendSet(); |
| 1717 if (send !== null) return f(send.arguments.head); | 1714 if (send !== null) return f(send.arguments.head); |
| 1718 } | 1715 } |
| OLD | NEW |