| 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 dart2js.scanner.array_based; | 5 library dart2js.scanner.array_based; |
| 6 | 6 |
| 7 import '../io/source_file.dart' show SourceFile; | 7 import '../io/source_file.dart' show SourceFile; |
| 8 import '../tokens/keyword.dart' show Keyword; | 8 import '../tokens/keyword.dart' show Keyword; |
| 9 import '../tokens/precedence.dart' show PrecedenceInfo; | 9 import '../tokens/precedence.dart' show PrecedenceInfo; |
| 10 import '../tokens/precedence_constants.dart' as Precedence | 10 import '../tokens/precedence_constants.dart' as Precedence |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 appendPrecedenceToken(no); | 56 appendPrecedenceToken(no); |
| 57 return next; | 57 return next; |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 /** | 61 /** |
| 62 * Appends a keyword token whose kind is determined by [keyword]. | 62 * Appends a keyword token whose kind is determined by [keyword]. |
| 63 */ | 63 */ |
| 64 void appendKeywordToken(Keyword keyword) { | 64 void appendKeywordToken(Keyword keyword) { |
| 65 String syntax = keyword.syntax; | 65 String syntax = keyword.syntax; |
| 66 // Type parameters and arguments cannot contain 'this' or 'super'. | 66 // Type parameters and arguments cannot contain 'this'. |
| 67 if (identical(syntax, 'this') || identical(syntax, 'super')) { | 67 if (identical(syntax, 'this')) { |
| 68 discardOpenLt(); | 68 discardOpenLt(); |
| 69 } | 69 } |
| 70 tail.next = new KeywordToken(keyword, tokenStart); | 70 tail.next = new KeywordToken(keyword, tokenStart); |
| 71 tail = tail.next; | 71 tail = tail.next; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void appendEofToken() { | 74 void appendEofToken() { |
| 75 beginToken(); | 75 beginToken(); |
| 76 discardOpenLt(); | 76 discardOpenLt(); |
| 77 while (!groupingStack.isEmpty) { | 77 while (!groupingStack.isEmpty) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 * something which cannot possibly be part of a type parameter/argument | 225 * something which cannot possibly be part of a type parameter/argument |
| 226 * list, like the '=' in the above example. | 226 * list, like the '=' in the above example. |
| 227 */ | 227 */ |
| 228 void discardOpenLt() { | 228 void discardOpenLt() { |
| 229 while (!groupingStack.isEmpty && | 229 while (!groupingStack.isEmpty && |
| 230 identical(groupingStack.head.kind, Tokens.LT_TOKEN)) { | 230 identical(groupingStack.head.kind, Tokens.LT_TOKEN)) { |
| 231 groupingStack = groupingStack.tail; | 231 groupingStack = groupingStack.tail; |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 } | 234 } |
| OLD | NEW |