| 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; | 7 import 'error_token.dart' show ErrorToken; |
| 8 | 8 |
| 9 import 'keyword.dart' show Keyword; | 9 import 'keyword.dart' show Keyword; |
| 10 | 10 |
| 11 import 'precedence.dart' show COMMENT_INFO, EOF_INFO, PrecedenceInfo; | 11 import 'precedence.dart' show EOF_INFO, PrecedenceInfo; |
| 12 | 12 |
| 13 import 'token.dart' | 13 import 'token.dart' |
| 14 show BeginGroupToken, KeywordToken, StringToken, SymbolToken, Token; | 14 show BeginGroupToken, KeywordToken, StringToken, SymbolToken, Token; |
| 15 | 15 |
| 16 import 'token_constants.dart' | 16 import 'token_constants.dart' |
| 17 show | 17 show |
| 18 LT_TOKEN, | 18 LT_TOKEN, |
| 19 OPEN_CURLY_BRACKET_TOKEN, | 19 OPEN_CURLY_BRACKET_TOKEN, |
| 20 OPEN_PAREN_TOKEN, | 20 OPEN_PAREN_TOKEN, |
| 21 STRING_INTERPOLATION_TOKEN; | 21 STRING_INTERPOLATION_TOKEN; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // '<', the inner '<' is left without endGroup. | 218 // '<', the inner '<' is left without endGroup. |
| 219 groupingStack = groupingStack.tail; | 219 groupingStack = groupingStack.tail; |
| 220 } | 220 } |
| 221 if (groupingStack.isEmpty) return; | 221 if (groupingStack.isEmpty) return; |
| 222 if (identical(groupingStack.head.kind, LT_TOKEN)) { | 222 if (identical(groupingStack.head.kind, LT_TOKEN)) { |
| 223 groupingStack.head.endGroup = tail; | 223 groupingStack.head.endGroup = tail; |
| 224 groupingStack = groupingStack.tail; | 224 groupingStack = groupingStack.tail; |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 void appendComment(start, bool asciiOnly) { | 228 void appendComment(start, PrecedenceInfo info, bool asciiOnly) { |
| 229 if (!includeComments) return; | 229 if (!includeComments) return; |
| 230 Token newComment = createSubstringToken(COMMENT_INFO, start, asciiOnly); | 230 Token newComment = createSubstringToken(info, start, asciiOnly); |
| 231 if (comments == null) { | 231 if (comments == null) { |
| 232 comments = newComment; | 232 comments = newComment; |
| 233 commentsTail = comments; | 233 commentsTail = comments; |
| 234 } else { | 234 } else { |
| 235 commentsTail.next = newComment; | 235 commentsTail.next = newComment; |
| 236 commentsTail.next.previousToken = commentsTail; | 236 commentsTail.next.previousToken = commentsTail; |
| 237 commentsTail = commentsTail.next; | 237 commentsTail = commentsTail.next; |
| 238 } | 238 } |
| 239 } | 239 } |
| 240 | 240 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 * something which cannot possibly be part of a type parameter/argument | 272 * something which cannot possibly be part of a type parameter/argument |
| 273 * list, like the '=' in the above example. | 273 * list, like the '=' in the above example. |
| 274 */ | 274 */ |
| 275 void discardOpenLt() { | 275 void discardOpenLt() { |
| 276 while (!groupingStack.isEmpty && | 276 while (!groupingStack.isEmpty && |
| 277 identical(groupingStack.head.kind, LT_TOKEN)) { | 277 identical(groupingStack.head.kind, LT_TOKEN)) { |
| 278 groupingStack = groupingStack.tail; | 278 groupingStack = groupingStack.tail; |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 } | 281 } |
| OLD | NEW |