OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library dart_parser; | 5 library dart_parser; |
6 | 6 |
7 import 'package:dart_scanner/src/token.dart' show | 7 import 'package:dart_scanner/src/token.dart' show |
8 Token; | 8 Token; |
9 | 9 |
10 import 'src/listener.dart' show | 10 import 'src/listener.dart' show |
11 Listener; | 11 Listener; |
12 | 12 |
13 import 'src/parser.dart' show | 13 import 'src/parser.dart' show |
14 Parser; | 14 Parser; |
15 | 15 |
16 import 'src/listener.dart' show | 16 import 'src/listener.dart' show |
17 ParserError; | 17 ParserError; |
18 | 18 |
19 export 'src/listener.dart' show | 19 export 'src/listener.dart' show |
20 ParserError; | 20 ParserError; |
21 | 21 |
22 List<ParserError> parse(Token tokens, {bool enableGenericMethodSyntax: false}) { | 22 List<ParserError> parse(Token tokens) { |
23 Listener listener = new Listener(); | 23 Listener listener = new Listener(); |
24 Parser parser = new Parser(listener, | 24 Parser parser = new Parser(listener); |
25 enableGenericMethodSyntax: enableGenericMethodSyntax); | |
26 parser.parseUnit(tokens); | 25 parser.parseUnit(tokens); |
27 return listener.recoverableErrors; | 26 return listener.recoverableErrors; |
28 } | 27 } |
OLD | NEW |