Skip to content

Commit

Permalink
Parse YieldStatement with Fasta.
Browse files Browse the repository at this point in the history
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2769133004 .
  • Loading branch information
scheglov committed Mar 24, 2017
1 parent 0842fb4 commit 9b6c63a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
9 changes: 9 additions & 0 deletions pkg/analyzer/lib/src/fasta/ast_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,15 @@ class AstBuilder extends ScopeListener {
body));
}

@override
void endYieldStatement(Token yieldToken, Token starToken, Token endToken) {
debugEvent("YieldStatement");
assert(endToken.lexeme == ';');
Expression expression = pop();
push(ast.yieldStatement(toAnalyzerToken(yieldToken),
toAnalyzerToken(starToken), expression, toAnalyzerToken(endToken)));
}

@override
void handleNoVariableInitializer(Token token) {
debugEvent("NoVariableInitializer");
Expand Down
18 changes: 0 additions & 18 deletions pkg/analyzer/test/generated/parser_fasta_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1087,12 +1087,6 @@ class StatementParserTest_Fasta extends FastaParserTestCase
super.test_parseContinueStatement_noLabel();
}

@override
@failingTest
void test_parseForStatement_each_await() {
super.test_parseForStatement_each_await();
}

@override
@failingTest
void test_parseForStatement_each_noType_metadata() {
Expand Down Expand Up @@ -1215,18 +1209,6 @@ class StatementParserTest_Fasta extends FastaParserTestCase
void test_parseTryStatement_on_catch_finally() {
super.test_parseTryStatement_on_catch_finally();
}

@override
@failingTest
void test_parseYieldStatement_each() {
super.test_parseYieldStatement_each();
}

@override
@failingTest
void test_parseYieldStatement_normal() {
super.test_parseYieldStatement_normal();
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/test/generated/parser_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12990,7 +12990,7 @@ abstract class StatementParserTestMixin implements AbstractParserTestCase {

Statement _parseAsyncStatement(String code, {bool isGenerator: false}) {
var star = isGenerator ? '*' : '';
var localFunction = parseStatement('wrapper() async$star { $code };')
var localFunction = parseStatement('wrapper() async$star { $code }')
as FunctionDeclarationStatement;
var localBody = localFunction.functionDeclaration.functionExpression.body
as BlockFunctionBody;
Expand Down
2 changes: 1 addition & 1 deletion pkg/front_end/test/fasta/kompile.status
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ map: Fail
mixin: Crash
operators: Crash
redirecting_constructor: Fail
statements: Crash
statements: Fail
super_rasta_copy: Crash
top_level_accessors: Crash
type_variable_as_super: Fail
Expand Down

0 comments on commit 9b6c63a

Please sign in to comment.