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

Side by Side Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 987633002: Better recovery (issue 22693) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 engine.parser_test; 5 library engine.parser_test;
6 6
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/error.dart'; 9 import 'package:analyzer/src/generated/error.dart';
10 import 'package:analyzer/src/generated/incremental_scanner.dart'; 10 import 'package:analyzer/src/generated/incremental_scanner.dart';
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT 910 ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT
911 ]); 911 ]);
912 } 912 }
913 913
914 void test_emptyEnumBody() { 914 void test_emptyEnumBody() {
915 ParserTestCase.parse3("parseEnumDeclaration", <Object>[ 915 ParserTestCase.parse3("parseEnumDeclaration", <Object>[
916 emptyCommentAndMetadata() 916 emptyCommentAndMetadata()
917 ], "enum E {}", [ParserErrorCode.EMPTY_ENUM_BODY]); 917 ], "enum E {}", [ParserErrorCode.EMPTY_ENUM_BODY]);
918 } 918 }
919 919
920 void test_enumInClass() {
921 ParserTestCase.parseCompilationUnit(r'''
922 class Foo {
923 enum Bar {
924 Bar1, Bar2, Bar3
925 }
926 }
927 ''', [ParserErrorCode.ENUM_IN_CLASS]);
928 }
929
920 void test_equalityCannotBeEqualityOperand_eq_eq() { 930 void test_equalityCannotBeEqualityOperand_eq_eq() {
921 ParserTestCase.parseExpression( 931 ParserTestCase.parseExpression(
922 "1 == 2 == 3", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]); 932 "1 == 2 == 3", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
923 } 933 }
924 934
925 void test_equalityCannotBeEqualityOperand_eq_neq() { 935 void test_equalityCannotBeEqualityOperand_eq_neq() {
926 ParserTestCase.parseExpression( 936 ParserTestCase.parseExpression(
927 "1 == 2 != 3", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]); 937 "1 == 2 != 3", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
928 } 938 }
929 939
(...skipping 9264 matching lines...) Expand 10 before | Expand all | Expand 10 after
10194 new Scanner(null, new CharSequenceReader(source), listener); 10204 new Scanner(null, new CharSequenceReader(source), listener);
10195 Token tokenStream = scanner.tokenize(); 10205 Token tokenStream = scanner.tokenize();
10196 // 10206 //
10197 // Parse the source. 10207 // Parse the source.
10198 // 10208 //
10199 Parser parser = new Parser(null, listener); 10209 Parser parser = new Parser(null, listener);
10200 return invokeParserMethodImpl( 10210 return invokeParserMethodImpl(
10201 parser, methodName, <Object>[tokenStream], tokenStream) as Token; 10211 parser, methodName, <Object>[tokenStream], tokenStream) as Token;
10202 } 10212 }
10203 } 10213 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698