Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Side by Side Diff: pkg/front_end/lib/src/fasta/scanner/recover.dart

Issue 2965393002: Use FastaMessage instead of String. Part 1. (Closed)
Patch Set: Add type variable to Code. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 FastaCode, 11 Code,
12 codeAsciiControlCharacter, 12 codeAsciiControlCharacter,
13 codeEncoding, 13 codeEncoding,
14 codeExpectedHexDigit, 14 codeExpectedHexDigit,
15 codeMissingExponent, 15 codeMissingExponent,
16 codeNonAsciiIdentifier, 16 codeNonAsciiIdentifier,
17 codeNonAsciiWhitespace, 17 codeNonAsciiWhitespace,
18 codeUnexpectedDollarInString, 18 codeUnexpectedDollarInString,
19 codeUnmatchedToken, 19 codeUnmatchedToken,
20 codeUnterminatedComment, 20 codeUnterminatedComment,
21 codeUnterminatedString; 21 codeUnterminatedString;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 if (errorTail == null) { 165 if (errorTail == null) {
166 error = next; 166 error = next;
167 } else { 167 } else {
168 errorTail.next = next; 168 errorTail.next = next;
169 next.previous = errorTail; 169 next.previous = errorTail;
170 } 170 }
171 errorTail = next; 171 errorTail = next;
172 next = next.next; 172 next = next.next;
173 } while (next is ErrorToken && first.errorCode == next.errorCode); 173 } while (next is ErrorToken && first.errorCode == next.errorCode);
174 174
175 FastaCode code = first.errorCode; 175 Code code = first.errorCode;
176 if (code == codeEncoding || 176 if (code == codeEncoding ||
177 code == codeNonAsciiWhitespace || 177 code == codeNonAsciiWhitespace ||
178 code == codeAsciiControlCharacter) { 178 code == codeAsciiControlCharacter) {
179 current = errorTail.next; 179 current = errorTail.next;
180 } else if (code == codeNonAsciiIdentifier) { 180 } else if (code == codeNonAsciiIdentifier) {
181 current = recoverIdentifier(first); 181 current = recoverIdentifier(first);
182 assert(current.next != null); 182 assert(current.next != null);
183 } else if (code == codeMissingExponent) { 183 } else if (code == codeMissingExponent) {
184 current = recoverExponent(); 184 current = recoverExponent();
185 assert(current.next != null); 185 assert(current.next != null);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/error_token.dart ('k') | pkg/front_end/lib/src/fasta/source/diet_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698