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

Unified Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 2748093004: Parse break and continue statements with Fasta. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index ec2370107ce20b4003d65d81914d324ae0a67ec8..264cb69154d76ddd3b0d5672c2e5133bbd3c21f6 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -10665,26 +10665,6 @@ void''');
expect(name.name, isNull);
}
- void test_parseContinueStatement_label() {
- createParser('continue foo;');
- ContinueStatement statement = parser.parseContinueStatement();
- expectNotNullIfNoErrors(statement);
- listener.assertErrorsWithCodes([ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
- expect(statement.continueKeyword, isNotNull);
- expect(statement.label, isNotNull);
- expect(statement.semicolon, isNotNull);
- }
-
- void test_parseContinueStatement_noLabel() {
- createParser('continue;');
- ContinueStatement statement = parser.parseContinueStatement();
- expectNotNullIfNoErrors(statement);
- listener.assertErrorsWithCodes([ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
- expect(statement.continueKeyword, isNotNull);
- expect(statement.label, isNull);
- expect(statement.semicolon, isNotNull);
- }
-
void test_parseDocumentationComment_block() {
createParser('/** */ class');
Comment comment = parser
@@ -12214,6 +12194,22 @@ abstract class StatementParserTestMixin implements AbstractParserTestCase {
expect(statement.semicolon, isNotNull);
}
+ void test_parseContinueStatement_label() {
+ var statement = parseStatement('continue foo;') as ContinueStatement;
+ assertErrorsWithCodes([ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
+ expect(statement.continueKeyword, isNotNull);
+ expect(statement.label, isNotNull);
+ expect(statement.semicolon, isNotNull);
+ }
+
+ void test_parseContinueStatement_noLabel() {
+ var statement = parseStatement('continue;') as ContinueStatement;
+ assertErrorsWithCodes([ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
+ expect(statement.continueKeyword, isNotNull);
+ expect(statement.label, isNull);
+ expect(statement.semicolon, isNotNull);
+ }
+
void test_parseDoStatement() {
var statement = parseStatement('do {} while (x);') as DoStatement;
assertNoErrors();
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698