Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: pkg/dart_parser/lib/dart_parser.dart

Issue 2650813002: Restructure parser error handling and recovery. (Closed)
Patch Set: Address comments. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.dart ('k') | pkg/dart_parser/lib/src/error_kind.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/parser.dart' show 19 export 'src/parser.dart' show
20 Parser; 20 Parser,
21 closeBraceFor,
22 optional;
21 23
22 export 'src/listener.dart' show 24 export 'src/listener.dart' show
23 Listener, 25 Listener,
24 ParserError, 26 ParserError;
25 closeBraceFor;
26 27
27 export 'src/error_kind.dart' show 28 export 'src/error_kind.dart' show
28 ErrorKind; 29 ErrorKind;
29 30
30 export 'src/top_level_parser.dart' show 31 export 'src/top_level_parser.dart' show
31 TopLevelParser; 32 TopLevelParser;
32 33
33 export 'src/class_member_parser.dart' show 34 export 'src/class_member_parser.dart' show
34 ClassMemberParser; 35 ClassMemberParser;
35 36
36 List<ParserError> parse(Token tokens) { 37 List<ParserError> parse(Token tokens) {
37 Listener listener = new Listener(); 38 Listener listener = new Listener();
38 Parser parser = new Parser(listener); 39 Parser parser = new Parser(listener);
39 parser.parseUnit(tokens); 40 parser.parseUnit(tokens);
40 return listener.recoverableErrors; 41 return listener.recoverableErrors;
41 } 42 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.dart ('k') | pkg/dart_parser/lib/src/error_kind.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698