OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 licenset hat can be found in the LICENSE file. | 3 // BSD-style licenset hat can be found in the LICENSE file. |
4 | 4 |
5 library fasta.scanner.recover; | 5 library fasta.scanner.recover; |
6 | 6 |
7 import '../../scanner/token.dart' show TokenType; | 7 import '../../scanner/token.dart' show TokenType; |
8 | 8 |
9 import '../fasta_codes.dart' | 9 import '../fasta_codes.dart' |
10 show | 10 show |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 recoverExponent() { | 130 recoverExponent() { |
131 return synthesizeToken(errorTail.charOffset, "NaN", TokenType.DOUBLE) | 131 return synthesizeToken(errorTail.charOffset, "NaN", TokenType.DOUBLE) |
132 ..next = errorTail.next; | 132 ..next = errorTail.next; |
133 } | 133 } |
134 | 134 |
135 recoverString() { | 135 recoverString() { |
136 return errorTail.next; | 136 return errorTail.next; |
137 } | 137 } |
138 | 138 |
139 recoverHexDigit() { | 139 recoverHexDigit() { |
140 return synthesizeToken(errorTail.charOffset, "-1", TokenType.INT) | 140 return synthesizeToken(errorTail.charOffset, "0", TokenType.INT) |
141 ..next = errorTail.next; | 141 ..next = errorTail.next; |
142 } | 142 } |
143 | 143 |
144 recoverStringInterpolation() { | 144 recoverStringInterpolation() { |
145 return errorTail.next; | 145 return errorTail.next; |
146 } | 146 } |
147 | 147 |
148 recoverComment() { | 148 recoverComment() { |
149 // TODO(ahe): Improve this. | 149 // TODO(ahe): Improve this. |
150 return skipToEof(errorTail); | 150 return skipToEof(errorTail); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 238 |
239 String closeBraceFor(String openBrace) { | 239 String closeBraceFor(String openBrace) { |
240 return const { | 240 return const { |
241 '(': ')', | 241 '(': ')', |
242 '[': ']', | 242 '[': ']', |
243 '{': '}', | 243 '{': '}', |
244 '<': '>', | 244 '<': '>', |
245 r'${': '}', | 245 r'${': '}', |
246 }[openBrace]; | 246 }[openBrace]; |
247 } | 247 } |
OLD | NEW |