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 analyzer.test.generated.parser_test; | 5 library analyzer.test.generated.parser_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
9 import 'package:analyzer/dart/ast/visitor.dart'; | 9 import 'package:analyzer/dart/ast/visitor.dart'; |
10 import 'package:analyzer/src/dart/ast/token.dart'; | 10 import 'package:analyzer/src/dart/ast/token.dart'; |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 void test_annotationOnEnumConstant_first() { | 710 void test_annotationOnEnumConstant_first() { |
711 ParserTestCase.parseCompilationUnit("enum E { @override C }", | 711 ParserTestCase.parseCompilationUnit("enum E { @override C }", |
712 [ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT]); | 712 [ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT]); |
713 } | 713 } |
714 | 714 |
715 void test_annotationOnEnumConstant_middle() { | 715 void test_annotationOnEnumConstant_middle() { |
716 ParserTestCase.parseCompilationUnit("enum E { C, @override D, E }", | 716 ParserTestCase.parseCompilationUnit("enum E { C, @override D, E }", |
717 [ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT]); | 717 [ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT]); |
718 } | 718 } |
719 | 719 |
720 void test_assertDoesNotTakeAssignment() { | |
721 parse4("parseAssertStatement", "assert(b = true);", | |
722 [ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT]); | |
723 } | |
724 | |
725 void test_assertDoesNotTakeCascades() { | |
726 parse4("parseAssertStatement", "assert(new A()..m());", | |
727 [ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE]); | |
728 } | |
729 | |
730 void test_assertDoesNotTakeRethrow() { | |
731 parse4("parseAssertStatement", "assert(rethrow);", | |
732 [ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW]); | |
733 } | |
734 | |
735 void test_assertDoesNotTakeThrow() { | |
736 parse4("parseAssertStatement", "assert(throw x);", | |
737 [ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW]); | |
738 } | |
739 | |
740 void test_breakOutsideOfLoop_breakInDoStatement() { | 720 void test_breakOutsideOfLoop_breakInDoStatement() { |
741 parse4("parseDoStatement", "do {break;} while (x);"); | 721 parse4("parseDoStatement", "do {break;} while (x);"); |
742 } | 722 } |
743 | 723 |
744 void test_breakOutsideOfLoop_breakInForStatement() { | 724 void test_breakOutsideOfLoop_breakInForStatement() { |
745 parse4("parseForStatement", "for (; x;) {break;}"); | 725 parse4("parseForStatement", "for (; x;) {break;}"); |
746 } | 726 } |
747 | 727 |
748 void test_breakOutsideOfLoop_breakInIfStatement() { | 728 void test_breakOutsideOfLoop_breakInIfStatement() { |
749 parse4("parseIfStatement", "if (x) {break;}", | 729 parse4("parseIfStatement", "if (x) {break;}", |
(...skipping 10556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11306 new Scanner(null, new CharSequenceReader(source), listener); | 11286 new Scanner(null, new CharSequenceReader(source), listener); |
11307 Token tokenStream = scanner.tokenize(); | 11287 Token tokenStream = scanner.tokenize(); |
11308 // | 11288 // |
11309 // Parse the source. | 11289 // Parse the source. |
11310 // | 11290 // |
11311 Parser parser = new Parser(null, listener); | 11291 Parser parser = new Parser(null, listener); |
11312 return invokeParserMethodImpl( | 11292 return invokeParserMethodImpl( |
11313 parser, methodName, <Object>[tokenStream], tokenStream) as Token; | 11293 parser, methodName, <Object>[tokenStream], tokenStream) as Token; |
11314 } | 11294 } |
11315 } | 11295 } |
OLD | NEW |