| OLD | NEW |
| 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 2336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2347 [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); | 2347 [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); |
| 2348 } | 2348 } |
| 2349 | 2349 |
| 2350 void test_unexpectedTerminatorForParameterGroup_optional() { | 2350 void test_unexpectedTerminatorForParameterGroup_optional() { |
| 2351 ParserTestCase.parse4( | 2351 ParserTestCase.parse4( |
| 2352 "parseFormalParameterList", | 2352 "parseFormalParameterList", |
| 2353 "(a, b])", | 2353 "(a, b])", |
| 2354 [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); | 2354 [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); |
| 2355 } | 2355 } |
| 2356 | 2356 |
| 2357 void test_unexpectedToken_endOfFieldDeclarationStatement() { |
| 2358 ParserTestCase.parseStatement( |
| 2359 "String s = (null));", |
| 2360 [ParserErrorCode.UNEXPECTED_TOKEN]); |
| 2361 } |
| 2362 |
| 2357 void test_unexpectedToken_semicolonBetweenClassMembers() { | 2363 void test_unexpectedToken_semicolonBetweenClassMembers() { |
| 2358 ParserTestCase.parse3( | 2364 ParserTestCase.parse3( |
| 2359 "parseClassDeclaration", | 2365 "parseClassDeclaration", |
| 2360 <Object>[emptyCommentAndMetadata(), null], | 2366 <Object>[emptyCommentAndMetadata(), null], |
| 2361 "class C { int x; ; int y;}", | 2367 "class C { int x; ; int y;}", |
| 2362 [ParserErrorCode.UNEXPECTED_TOKEN]); | 2368 [ParserErrorCode.UNEXPECTED_TOKEN]); |
| 2363 } | 2369 } |
| 2364 | 2370 |
| 2365 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { | 2371 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { |
| 2366 ParserTestCase.parseCompilationUnit( | 2372 ParserTestCase.parseCompilationUnit( |
| (...skipping 8571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10938 // Parse the source. | 10944 // Parse the source. |
| 10939 // | 10945 // |
| 10940 Parser parser = new Parser(null, listener); | 10946 Parser parser = new Parser(null, listener); |
| 10941 return invokeParserMethodImpl( | 10947 return invokeParserMethodImpl( |
| 10942 parser, | 10948 parser, |
| 10943 methodName, | 10949 methodName, |
| 10944 <Object>[tokenStream], | 10950 <Object>[tokenStream], |
| 10945 tokenStream) as Token; | 10951 tokenStream) as Token; |
| 10946 } | 10952 } |
| 10947 } | 10953 } |
| OLD | NEW |