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

Unified Diff: src/parsing/preparser.cc

Issue 2321103002: [parser] Refactor of Parse*Statement*, part 5 (Closed)
Patch Set: Rebase Created 4 years, 3 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
« no previous file with comments | « src/parsing/preparser.h ('k') | test/cctest/interpreter/bytecode_expectations/DoExpression.golden » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index cf0a5ee6c4504076b4a05c4feb90f0a441f19622..70f56cb758ca953cd871db4193bff098ad8280d2 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -200,34 +200,6 @@ PreParser::Statement PreParser::ParseSwitchStatement(
return Statement::Default();
}
-PreParser::Statement PreParser::ParseDoWhileStatement(
- ZoneList<const AstRawString*>* labels, bool* ok) {
- // DoStatement ::
- // 'do' Statement 'while' '(' Expression ')' ';'
-
- Expect(Token::DO, CHECK_OK);
- ParseScopedStatement(nullptr, true, CHECK_OK);
- Expect(Token::WHILE, CHECK_OK);
- Expect(Token::LPAREN, CHECK_OK);
- ParseExpression(true, CHECK_OK);
- Expect(Token::RPAREN, ok);
- if (peek() == Token::SEMICOLON) Consume(Token::SEMICOLON);
- return Statement::Default();
-}
-
-PreParser::Statement PreParser::ParseWhileStatement(
- ZoneList<const AstRawString*>* labels, bool* ok) {
- // WhileStatement ::
- // 'while' '(' Expression ')' Statement
-
- Expect(Token::WHILE, CHECK_OK);
- Expect(Token::LPAREN, CHECK_OK);
- ParseExpression(true, CHECK_OK);
- Expect(Token::RPAREN, CHECK_OK);
- ParseScopedStatement(nullptr, true, ok);
- return Statement::Default();
-}
-
PreParser::Statement PreParser::ParseForStatement(
ZoneList<const AstRawString*>* labels, bool* ok) {
// ForStatement ::
@@ -362,22 +334,6 @@ PreParser::Statement PreParser::ParseForStatement(
}
-PreParser::Statement PreParser::ParseThrowStatement(bool* ok) {
- // ThrowStatement ::
- // 'throw' [no line terminator] Expression ';'
-
- Expect(Token::THROW, CHECK_OK);
- if (scanner()->HasAnyLineTerminatorBeforeNext()) {
- ReportMessageAt(scanner()->location(), MessageTemplate::kNewlineAfterThrow);
- *ok = false;
- return Statement::Default();
- }
- ParseExpression(true, CHECK_OK);
- ExpectSemicolon(ok);
- return Statement::Jump();
-}
-
-
PreParser::Statement PreParser::ParseTryStatement(bool* ok) {
// TryStatement ::
// 'try' Block Catch
@@ -609,18 +565,6 @@ PreParserExpression PreParser::ParseClassLiteral(
return Expression::Default();
}
-PreParserExpression PreParser::ParseDoExpression(bool* ok) {
- // AssignmentExpression ::
- // do '{' StatementList '}'
- Expect(Token::DO, CHECK_OK);
- Expect(Token::LBRACE, CHECK_OK);
- while (peek() != Token::RBRACE) {
- ParseStatementListItem(CHECK_OK);
- }
- Expect(Token::RBRACE, CHECK_OK);
- return PreParserExpression::Default();
-}
-
void PreParser::ParseAsyncArrowSingleExpressionBody(PreParserStatementList body,
bool accept_IN, int pos,
bool* ok) {
« no previous file with comments | « src/parsing/preparser.h ('k') | test/cctest/interpreter/bytecode_expectations/DoExpression.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698