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

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

Issue 2842213003: new TokenType and Keyword API (Closed)
Patch Set: rebase Created 3 years, 7 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, UnmatchedToken; 7 import 'error_token.dart' show ErrorToken, UnmatchedToken;
8 8
9 import '../../scanner/token.dart' show Keyword, TokenType; 9 import '../../scanner/token.dart' show Keyword, TokenType;
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } else { 68 } else {
69 appendPrecedenceToken(no); 69 appendPrecedenceToken(no);
70 return next; 70 return next;
71 } 71 }
72 } 72 }
73 73
74 /** 74 /**
75 * Appends a keyword token whose kind is determined by [keyword]. 75 * Appends a keyword token whose kind is determined by [keyword].
76 */ 76 */
77 void appendKeywordToken(Keyword keyword) { 77 void appendKeywordToken(Keyword keyword) {
78 String syntax = keyword.syntax; 78 String syntax = keyword.lexeme;
79 // Type parameters and arguments cannot contain 'this'. 79 // Type parameters and arguments cannot contain 'this'.
80 if (identical(syntax, 'this')) { 80 if (identical(syntax, 'this')) {
81 discardOpenLt(); 81 discardOpenLt();
82 } 82 }
83 appendToken(new KeywordToken(keyword, tokenStart)); 83 appendToken(new KeywordToken(keyword, tokenStart));
84 } 84 }
85 85
86 void appendEofToken() { 86 void appendEofToken() {
87 beginToken(); 87 beginToken();
88 discardOpenLt(); 88 discardOpenLt();
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // | 297 // |
298 // next 298 // next
299 // v 299 // v
300 // EOF 300 // EOF
301 TokenType info = closeBraceInfoFor(begin); 301 TokenType info = closeBraceInfoFor(begin);
302 appendToken(new SyntheticSymbolToken(info, tokenStart)); 302 appendToken(new SyntheticSymbolToken(info, tokenStart));
303 begin.endGroup = tail; 303 begin.endGroup = tail;
304 appendErrorToken(new UnmatchedToken(begin)); 304 appendErrorToken(new UnmatchedToken(begin));
305 } 305 }
306 } 306 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/parser.dart ('k') | pkg/front_end/lib/src/fasta/scanner/keyword_state.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698