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

Unified Diff: pkg/dart_parser/lib/src/top_level_parser.dart

Issue 2642663003: Move skip methods to parser base class. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dart_parser/lib/src/parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dart_parser/lib/src/top_level_parser.dart
diff --git a/pkg/dart_parser/lib/src/top_level_parser.dart b/pkg/dart_parser/lib/src/top_level_parser.dart
index 4c1fbdbb8a78c849e3470f9dd7e3cfa58ff152f9..8eae855c9df3b4880b183ee4c0b4838ae539cd0b 100644
--- a/pkg/dart_parser/lib/src/top_level_parser.dart
+++ b/pkg/dart_parser/lib/src/top_level_parser.dart
@@ -5,21 +5,14 @@
library dart_parser.top_level_parser;
import 'package:dart_scanner/src/token.dart' show
- BeginGroupToken,
Token;
-import 'package:dart_scanner/src/characters.dart' show
- $CLOSE_CURLY_BRACKET;
-
import 'listener.dart' show
Listener;
import 'class_member_parser.dart' show
ClassMemberParser;
-import 'parser.dart' show
- optional;
-
/// Parser which only parses top-level elements, but ignores their bodies.
/// Use [Parser] to parse everything.
class TopLevelParser extends ClassMemberParser {
@@ -29,17 +22,5 @@ class TopLevelParser extends ClassMemberParser {
: super(listener, asyncAwaitKeywordsEnabled: asyncAwaitKeywordsEnabled,
enableGenericMethodSyntax: enableGenericMethodSyntax);
- Token parseClassBody(Token token) {
- if (!optional('{', token)) {
- return listener.expectedClassBodyToSkip(token);
- }
- BeginGroupToken beginGroupToken = token;
- Token endGroup = beginGroupToken.endGroup;
- if (endGroup == null) {
- return listener.unmatched(beginGroupToken);
- } else if (!identical(endGroup.kind, $CLOSE_CURLY_BRACKET)) {
- return listener.unmatched(beginGroupToken);
- }
- return endGroup;
- }
+ Token parseClassBody(Token token) => skipClassBody(token);
}
« no previous file with comments | « pkg/dart_parser/lib/src/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698