| 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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 | 699 |
| 700 accept(Visitor visitor) => visitor.visitLiteralDouble(this); | 700 accept(Visitor visitor) => visitor.visitLiteralDouble(this); |
| 701 } | 701 } |
| 702 | 702 |
| 703 class LiteralBool extends Literal<bool> { | 703 class LiteralBool extends Literal<bool> { |
| 704 LiteralBool(Token token, DecodeErrorHandler handler) : super(token, handler); | 704 LiteralBool(Token token, DecodeErrorHandler handler) : super(token, handler); |
| 705 | 705 |
| 706 LiteralBool asLiteralBool() => this; | 706 LiteralBool asLiteralBool() => this; |
| 707 | 707 |
| 708 bool get value { | 708 bool get value { |
| 709 if (token.value == Keyword.TRUE) return true; | 709 if (token.stringValue === 'true') return true; |
| 710 if (token.value == Keyword.FALSE) return false; | 710 if (token.stringValue === 'false') return false; |
| 711 (this.handler)(token, "not a bool ${token.value}"); | 711 (this.handler)(token, "not a bool ${token.value}"); |
| 712 } | 712 } |
| 713 | 713 |
| 714 accept(Visitor visitor) => visitor.visitLiteralBool(this); | 714 accept(Visitor visitor) => visitor.visitLiteralBool(this); |
| 715 } | 715 } |
| 716 | 716 |
| 717 | 717 |
| 718 class StringQuoting { | 718 class StringQuoting { |
| 719 static const StringQuoting SINGLELINE_DQ = | 719 static const StringQuoting SINGLELINE_DQ = |
| 720 const StringQuoting($DQ, raw: false, leftQuoteLength: 1); | 720 const StringQuoting($DQ, raw: false, leftQuoteLength: 1); |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1769 * argument). | 1769 * argument). |
| 1770 * | 1770 * |
| 1771 * TODO(ahe): This method is controversial, the team needs to discuss | 1771 * TODO(ahe): This method is controversial, the team needs to discuss |
| 1772 * if top-level methods are acceptable and what naming conventions to | 1772 * if top-level methods are acceptable and what naming conventions to |
| 1773 * use. | 1773 * use. |
| 1774 */ | 1774 */ |
| 1775 initializerDo(Node node, f(Node node)) { | 1775 initializerDo(Node node, f(Node node)) { |
| 1776 SendSet send = node.asSendSet(); | 1776 SendSet send = node.asSendSet(); |
| 1777 if (send !== null) return f(send.arguments.head); | 1777 if (send !== null) return f(send.arguments.head); |
| 1778 } | 1778 } |
| OLD | NEW |