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

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

Issue 2767083002: fasta scanner recovery and error code translation improvements (Closed)
Patch Set: revert address comments and fix for token_stream_rewriter test Created 3 years, 9 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 library fasta.scanner.array_based_scanner; 5 library fasta.scanner.array_based_scanner;
6 6
7 import 'error_token.dart' show ErrorToken; 7 import 'error_token.dart' show ErrorToken;
8 8
9 import 'keyword.dart' show Keyword; 9 import 'keyword.dart' show Keyword;
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 appendToken(new KeywordToken(keyword, tokenStart)); 100 appendToken(new KeywordToken(keyword, tokenStart));
101 } 101 }
102 102
103 void appendEofToken() { 103 void appendEofToken() {
104 beginToken(); 104 beginToken();
105 discardOpenLt(); 105 discardOpenLt();
106 while (!groupingStack.isEmpty) { 106 while (!groupingStack.isEmpty) {
107 unmatchedBeginGroup(groupingStack.head); 107 unmatchedBeginGroup(groupingStack.head);
108 groupingStack = groupingStack.tail; 108 groupingStack = groupingStack.tail;
109 } 109 }
110 appendToken(new SymbolToken(EOF_INFO, tokenStart)); 110 appendToken(new SymbolToken.eof(tokenStart));
111 // EOF points to itself so there's always infinite look-ahead.
112 tail.next = tail;
113 } 111 }
114 112
115 /** 113 /**
116 * Notifies scanning a whitespace character. Note that [appendWhiteSpace] is 114 * Notifies scanning a whitespace character. Note that [appendWhiteSpace] is
117 * not always invoked for [$SPACE] characters. 115 * not always invoked for [$SPACE] characters.
118 * 116 *
119 * This method is used by the scanners to track line breaks and create the 117 * This method is used by the scanners to track line breaks and create the
120 * [lineStarts] map. 118 * [lineStarts] map.
121 */ 119 */
122 void appendWhiteSpace(int next) { 120 void appendWhiteSpace(int next) {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 * something which cannot possibly be part of a type parameter/argument 313 * something which cannot possibly be part of a type parameter/argument
316 * list, like the '=' in the above example. 314 * list, like the '=' in the above example.
317 */ 315 */
318 void discardOpenLt() { 316 void discardOpenLt() {
319 while (!groupingStack.isEmpty && 317 while (!groupingStack.isEmpty &&
320 identical(groupingStack.head.kind, LT_TOKEN)) { 318 identical(groupingStack.head.kind, LT_TOKEN)) {
321 groupingStack = groupingStack.tail; 319 groupingStack = groupingStack.tail;
322 } 320 }
323 } 321 }
324 } 322 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart ('k') | pkg/front_end/lib/src/fasta/scanner/recover.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698