OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 dart_scanner.abstract_scanner; | 5 library dart_scanner.abstract_scanner; |
6 | 6 |
7 import '../dart_scanner.dart' show | 7 import '../dart_scanner.dart' show |
8 Scanner; | 8 Scanner; |
9 | 9 |
10 import 'keyword.dart' show | 10 import 'keyword.dart' show |
(...skipping 10 matching lines...) Expand all Loading... |
21 SymbolToken, | 21 SymbolToken, |
22 Token, | 22 Token, |
23 UnmatchedToken, | 23 UnmatchedToken, |
24 UnterminatedToken; | 24 UnterminatedToken; |
25 | 25 |
26 import 'token_constants.dart'; | 26 import 'token_constants.dart'; |
27 | 27 |
28 import 'characters.dart'; | 28 import 'characters.dart'; |
29 | 29 |
30 abstract class AbstractScanner implements Scanner { | 30 abstract class AbstractScanner implements Scanner { |
31 // TODO(ahe): Move this class to implementation. | |
32 | |
33 final bool includeComments; | 31 final bool includeComments; |
34 | 32 |
35 /** | 33 /** |
36 * The string offset for the next token that will be created. | 34 * The string offset for the next token that will be created. |
37 * | 35 * |
38 * Note that in the [Utf8BytesScanner], [stringOffset] and [scanOffset] values | 36 * Note that in the [Utf8BytesScanner], [stringOffset] and [scanOffset] values |
39 * are different. One string character can be encoded using multiple UTF-8 | 37 * are different. One string character can be encoded using multiple UTF-8 |
40 * bytes. | 38 * bytes. |
41 */ | 39 */ |
42 int tokenStart = -1; | 40 int tokenStart = -1; |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 | 1163 |
1166 PrecedenceInfo closeBraceInfoFor(BeginGroupToken begin) { | 1164 PrecedenceInfo closeBraceInfoFor(BeginGroupToken begin) { |
1167 return const { | 1165 return const { |
1168 '(': CLOSE_PAREN_INFO, | 1166 '(': CLOSE_PAREN_INFO, |
1169 '[': CLOSE_SQUARE_BRACKET_INFO, | 1167 '[': CLOSE_SQUARE_BRACKET_INFO, |
1170 '{': CLOSE_CURLY_BRACKET_INFO, | 1168 '{': CLOSE_CURLY_BRACKET_INFO, |
1171 '<': GT_INFO, | 1169 '<': GT_INFO, |
1172 r'${': CLOSE_CURLY_BRACKET_INFO, | 1170 r'${': CLOSE_CURLY_BRACKET_INFO, |
1173 }[begin.value]; | 1171 }[begin.value]; |
1174 } | 1172 } |
OLD | NEW |