| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 if (append) { | 121 if (append) { |
| 122 codeUnits.addAll(next.lexeme.codeUnits); | 122 codeUnits.addAll(next.lexeme.codeUnits); |
| 123 next = next.next; | 123 next = next.next; |
| 124 } | 124 } |
| 125 String value = new String.fromCharCodes(codeUnits); | 125 String value = new String.fromCharCodes(codeUnits); |
| 126 return synthesizeToken(charOffset, value, TokenType.IDENTIFIER) | 126 return synthesizeToken(charOffset, value, TokenType.IDENTIFIER) |
| 127 ..next = next; | 127 ..next = next; |
| 128 } | 128 } |
| 129 | 129 |
| 130 recoverExponent() { | 130 recoverExponent() { |
| 131 return synthesizeToken(errorTail.charOffset, "NaN", TokenType.DOUBLE) | 131 return errorTail.next; |
| 132 ..next = errorTail.next; | |
| 133 } | 132 } |
| 134 | 133 |
| 135 recoverString() { | 134 recoverString() { |
| 136 return errorTail.next; | 135 return errorTail.next; |
| 137 } | 136 } |
| 138 | 137 |
| 139 recoverHexDigit() { | 138 recoverHexDigit() { |
| 140 return synthesizeToken(errorTail.charOffset, "0", TokenType.INT) | 139 return synthesizeToken(errorTail.charOffset, "0", TokenType.INT) |
| 141 ..next = errorTail.next; | 140 ..next = errorTail.next; |
| 142 } | 141 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 237 |
| 239 String closeBraceFor(String openBrace) { | 238 String closeBraceFor(String openBrace) { |
| 240 return const { | 239 return const { |
| 241 '(': ')', | 240 '(': ')', |
| 242 '[': ']', | 241 '[': ']', |
| 243 '{': '}', | 242 '{': '}', |
| 244 '<': '>', | 243 '<': '>', |
| 245 r'${': '}', | 244 r'${': '}', |
| 246 }[openBrace]; | 245 }[openBrace]; |
| 247 } | 246 } |
| OLD | NEW |