| 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 dart2js.scanner; | 5 library dart2js.scanner; |
| 6 | 6 |
| 7 import '../io/source_file.dart' show SourceFile, Utf8BytesSourceFile; | 7 import '../io/source_file.dart' show SourceFile, Utf8BytesSourceFile; |
| 8 import '../tokens/keyword.dart' show Keyword, KeywordState; | 8 import '../tokens/keyword.dart' show Keyword, KeywordState; |
| 9 import '../tokens/precedence.dart'; | 9 import '../tokens/precedence.dart'; |
| 10 import '../tokens/precedence_constants.dart'; | 10 import '../tokens/precedence_constants.dart'; |
| 11 import '../tokens/token.dart'; | 11 import '../tokens/token.dart'; |
| 12 import '../tokens/token_constants.dart'; | 12 import '../tokens/token_constants.dart'; |
| 13 import '../util/characters.dart'; | 13 import '../util/characters.dart'; |
| 14 | |
| 15 import 'string_scanner.dart' show StringScanner; | 14 import 'string_scanner.dart' show StringScanner; |
| 16 import 'utf8_bytes_scanner.dart' show Utf8BytesScanner; | 15 import 'utf8_bytes_scanner.dart' show Utf8BytesScanner; |
| 17 | 16 |
| 18 abstract class Scanner { | 17 abstract class Scanner { |
| 19 Token tokenize(); | 18 Token tokenize(); |
| 20 | 19 |
| 21 factory Scanner(SourceFile file, {bool includeComments: false}) { | 20 factory Scanner(SourceFile file, {bool includeComments: false}) { |
| 22 if (file is Utf8BytesSourceFile) { | 21 if (file is Utf8BytesSourceFile) { |
| 23 return new Utf8BytesScanner(file, includeComments: includeComments); | 22 return new Utf8BytesScanner(file, includeComments: includeComments); |
| 24 } else { | 23 } else { |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 | 1176 |
| 1178 PrecedenceInfo closeBraceInfoFor(BeginGroupToken begin) { | 1177 PrecedenceInfo closeBraceInfoFor(BeginGroupToken begin) { |
| 1179 return const { | 1178 return const { |
| 1180 '(': CLOSE_PAREN_INFO, | 1179 '(': CLOSE_PAREN_INFO, |
| 1181 '[': CLOSE_SQUARE_BRACKET_INFO, | 1180 '[': CLOSE_SQUARE_BRACKET_INFO, |
| 1182 '{': CLOSE_CURLY_BRACKET_INFO, | 1181 '{': CLOSE_CURLY_BRACKET_INFO, |
| 1183 '<': GT_INFO, | 1182 '<': GT_INFO, |
| 1184 r'${': CLOSE_CURLY_BRACKET_INFO, | 1183 r'${': CLOSE_CURLY_BRACKET_INFO, |
| 1185 }[begin.value]; | 1184 }[begin.value]; |
| 1186 } | 1185 } |
| OLD | NEW |