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

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

Issue 668083002: Better recovery for getters in functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
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/java_core.dart'; 10 import 'package:analyzer/src/generated/java_core.dart';
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 } 915 }
916 916
917 void test_functionTypedParameter_final() { 917 void test_functionTypedParameter_final() {
918 ParserTestCase.parseCompilationUnit("void f(final x()) {}", [ParserErrorCode .FUNCTION_TYPED_PARAMETER_VAR]); 918 ParserTestCase.parseCompilationUnit("void f(final x()) {}", [ParserErrorCode .FUNCTION_TYPED_PARAMETER_VAR]);
919 } 919 }
920 920
921 void test_functionTypedParameter_var() { 921 void test_functionTypedParameter_var() {
922 ParserTestCase.parseCompilationUnit("void f(var x()) {}", [ParserErrorCode.F UNCTION_TYPED_PARAMETER_VAR]); 922 ParserTestCase.parseCompilationUnit("void f(var x()) {}", [ParserErrorCode.F UNCTION_TYPED_PARAMETER_VAR]);
923 } 923 }
924 924
925 void test_getterInFunction_block() { 925 void test_getterInFunction_block_noReturnType() {
926 ParserTestCase.parseStatement("get x { return _x; }", [ParserErrorCode.GETTE R_IN_FUNCTION]); 926 ParserTestCase.parseStatement("get x { return _x; }", [ParserErrorCode.GETTE R_IN_FUNCTION]);
927 } 927 }
928 928
929 void test_getterInFunction_expression() { 929 void test_getterInFunction_block_returnType() {
930 ParserTestCase.parseStatement("int get x { return _x; }", [ParserErrorCode.G ETTER_IN_FUNCTION]);
931 }
932
933 void test_getterInFunction_expression_noReturnType() {
930 ParserTestCase.parseStatement("get x => _x;", [ParserErrorCode.GETTER_IN_FUN CTION]); 934 ParserTestCase.parseStatement("get x => _x;", [ParserErrorCode.GETTER_IN_FUN CTION]);
931 } 935 }
932 936
937 void test_getterInFunction_expression_returnType() {
938 ParserTestCase.parseStatement("int get x => _x;", [ParserErrorCode.GETTER_IN _FUNCTION]);
939 }
940
933 void test_getterWithParameters() { 941 void test_getterWithParameters() {
934 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "int get x() {}", [ParserErrorCode.GETTER_WITH_PARAMETERS]); 942 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "int get x() {}", [ParserErrorCode.GETTER_WITH_PARAMETERS]);
935 } 943 }
936 944
937 void test_illegalAssignmentToNonAssignable_postfix_minusMinus_literal() { 945 void test_illegalAssignmentToNonAssignable_postfix_minusMinus_literal() {
938 ParserTestCase.parseExpression("0--", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO _NON_ASSIGNABLE]); 946 ParserTestCase.parseExpression("0--", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO _NON_ASSIGNABLE]);
939 } 947 }
940 948
941 void test_illegalAssignmentToNonAssignable_postfix_plusPlus_literal() { 949 void test_illegalAssignmentToNonAssignable_postfix_plusPlus_literal() {
942 ParserTestCase.parseExpression("0++", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO _NON_ASSIGNABLE]); 950 ParserTestCase.parseExpression("0++", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO _NON_ASSIGNABLE]);
(...skipping 7309 matching lines...) Expand 10 before | Expand all | Expand 10 after
8252 main() { 8260 main() {
8253 _ut.groupSep = ' | '; 8261 _ut.groupSep = ' | ';
8254 runReflectiveTests(ComplexParserTest); 8262 runReflectiveTests(ComplexParserTest);
8255 runReflectiveTests(ErrorParserTest); 8263 runReflectiveTests(ErrorParserTest);
8256 runReflectiveTests(IncrementalParserTest); 8264 runReflectiveTests(IncrementalParserTest);
8257 runReflectiveTests(NonErrorParserTest); 8265 runReflectiveTests(NonErrorParserTest);
8258 runReflectiveTests(RecoveryParserTest); 8266 runReflectiveTests(RecoveryParserTest);
8259 runReflectiveTests(ResolutionCopierTest); 8267 runReflectiveTests(ResolutionCopierTest);
8260 runReflectiveTests(SimpleParserTest); 8268 runReflectiveTests(SimpleParserTest);
8261 } 8269 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698