| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |