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

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

Issue 692303003: Fix for issue 19100 - better recovery (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.parser_test; 8 library engine.parser_test;
9 9
10 import 'package:analyzer/src/generated/error.dart'; 10 import 'package:analyzer/src/generated/error.dart';
(...skipping 5665 matching lines...) Expand 10 before | Expand all | Expand 10 after
5676 expect(result.keyword, isNull); 5676 expect(result.keyword, isNull);
5677 expect(result.type, isNotNull); 5677 expect(result.type, isNotNull);
5678 } 5678 }
5679 5679
5680 void test_parseFinalConstVarOrType_type_prefixed() { 5680 void test_parseFinalConstVarOrType_type_prefixed() {
5681 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A a"); 5681 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A a");
5682 expect(result.keyword, isNull); 5682 expect(result.keyword, isNull);
5683 expect(result.type, isNotNull); 5683 expect(result.type, isNotNull);
5684 } 5684 }
5685 5685
5686 void test_parseFinalConstVarOrType_type_prefixed_noIdentifier() {
5687 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A,");
5688 expect(result.keyword, isNull);
5689 expect(result.type, isNotNull);
5690 }
5691
5686 void test_parseFinalConstVarOrType_type_prefixedAndParameterized() { 5692 void test_parseFinalConstVarOrType_type_prefixedAndParameterized() {
5687 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A<B> a"); 5693 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A<B> a");
5688 expect(result.keyword, isNull); 5694 expect(result.keyword, isNull);
5689 expect(result.type, isNotNull); 5695 expect(result.type, isNotNull);
5690 } 5696 }
5691 5697
5692 void test_parseFinalConstVarOrType_type_simple() { 5698 void test_parseFinalConstVarOrType_type_simple() {
5693 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "A a"); 5699 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "A a");
5694 expect(result.keyword, isNull); 5700 expect(result.keyword, isNull);
5695 expect(result.type, isNotNull); 5701 expect(result.type, isNotNull);
5696 } 5702 }
5697 5703
5698 void test_parseFinalConstVarOrType_var() { 5704 void test_parseFinalConstVarOrType_var() {
5699 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "var"); 5705 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "var");
5700 Token keyword = result.keyword; 5706 Token keyword = result.keyword;
5701 expect(keyword, isNotNull); 5707 expect(keyword, isNotNull);
5702 expect(keyword.type, TokenType.KEYWORD); 5708 expect(keyword.type, TokenType.KEYWORD);
5703 expect((keyword as KeywordToken).keyword, Keyword.VAR); 5709 expect((keyword as KeywordToken).keyword, Keyword.VAR);
5704 expect(result.type, isNull); 5710 expect(result.type, isNull);
5705 } 5711 }
5706 5712
5713 void test_parseFinalConstVarOrType_void() {
5714 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "void f()");
5715 expect(result.keyword, isNull);
5716 expect(result.type, isNotNull);
5717 }
5718
5719 void test_parseFinalConstVarOrType_void_noIdentifier() {
5720 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "void,");
5721 expect(result.keyword, isNull);
5722 expect(result.type, isNotNull);
5723 }
5724
5707 void test_parseFormalParameter_final_withType_named() { 5725 void test_parseFormalParameter_final_withType_named() {
5708 ParameterKind kind = ParameterKind.NAMED; 5726 ParameterKind kind = ParameterKind.NAMED;
5709 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete r", <Object> [kind], "final A a : null"); 5727 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete r", <Object> [kind], "final A a : null");
5710 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter; 5728 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter;
5711 expect(simpleParameter.identifier, isNotNull); 5729 expect(simpleParameter.identifier, isNotNull);
5712 expect(simpleParameter.keyword, isNotNull); 5730 expect(simpleParameter.keyword, isNotNull);
5713 expect(simpleParameter.type, isNotNull); 5731 expect(simpleParameter.type, isNotNull);
5714 expect(simpleParameter.kind, kind); 5732 expect(simpleParameter.kind, kind);
5715 expect(parameter.separator, isNotNull); 5733 expect(parameter.separator, isNotNull);
5716 expect(parameter.defaultValue, isNotNull); 5734 expect(parameter.defaultValue, isNotNull);
(...skipping 2559 matching lines...) Expand 10 before | Expand all | Expand 10 after
8276 main() { 8294 main() {
8277 groupSep = ' | '; 8295 groupSep = ' | ';
8278 runReflectiveTests(ComplexParserTest); 8296 runReflectiveTests(ComplexParserTest);
8279 runReflectiveTests(ErrorParserTest); 8297 runReflectiveTests(ErrorParserTest);
8280 runReflectiveTests(IncrementalParserTest); 8298 runReflectiveTests(IncrementalParserTest);
8281 runReflectiveTests(NonErrorParserTest); 8299 runReflectiveTests(NonErrorParserTest);
8282 runReflectiveTests(RecoveryParserTest); 8300 runReflectiveTests(RecoveryParserTest);
8283 runReflectiveTests(ResolutionCopierTest); 8301 runReflectiveTests(ResolutionCopierTest);
8284 runReflectiveTests(SimpleParserTest); 8302 runReflectiveTests(SimpleParserTest);
8285 } 8303 }
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