Commit cb13d50a authored by nikolaos's avatar nikolaos Committed by Commit bot

[parser] Minor cleanup after refactoring

- Remove redundant "impl()->".
- Remove NewBlock method from "impl()", exists in "factory()".
- Resolve TODO comments.

R=adamk@chromium.org, marja@chromium.org
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2345103003
Cr-Commit-Position: refs/heads/master@{#39496}
parent 80033652
......@@ -3591,8 +3591,8 @@ typename ParserBase<Impl>::BlockT ParserBase<Impl>::ParseVariableDeclarations(
BlockT init_block = impl()->NullBlock();
if (var_context != kForStatement) {
init_block = impl()->NewBlock(nullptr, 1, true,
parsing_result->descriptor.declaration_pos);
init_block = factory()->NewBlock(
nullptr, 1, true, parsing_result->descriptor.declaration_pos);
}
switch (peek()) {
......@@ -4194,8 +4194,8 @@ ParserBase<Impl>::ParseStatementList(StatementListT body, int end_token,
bool starts_with_identifier = peek() == Token::IDENTIFIER;
Scanner::Location token_loc = scanner()->peek_location();
StatementT stat = impl()->ParseStatementListItem(
CHECK_OK_CUSTOM(Return, kLazyParsingComplete));
StatementT stat =
ParseStatementListItem(CHECK_OK_CUSTOM(Return, kLazyParsingComplete));
if (impl()->IsNullStatement(stat) || impl()->IsEmptyStatement(stat)) {
directive_prologue = false; // End of directive prologue.
......@@ -4233,18 +4233,15 @@ ParserBase<Impl>::ParseStatementList(StatementListT body, int end_token,
impl()->SetAsmModule();
} else if (impl()->IsStringLiteral(stat)) {
// Possibly an unknown directive.
// TODO(nikolaos): Check if the following is really what we want!
// """Should not change mode, but will increment UseCounter
// if appropriate. Ditto usages below.""" ???
// Should not change mode, but will increment usage counters
// as appropriate. Ditto usages below.
RaiseLanguageMode(SLOPPY);
} else {
// End of the directive prologue.
directive_prologue = false;
// TODO(nikolaos): Check if the following is really what we want!
RaiseLanguageMode(SLOPPY);
}
} else {
// TODO(nikolaos): Check if the following is really what we want!
RaiseLanguageMode(SLOPPY);
}
......@@ -4287,7 +4284,7 @@ typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseStatementListItem(
switch (peek()) {
case Token::FUNCTION:
return impl()->ParseHoistableDeclaration(nullptr, false, ok);
return ParseHoistableDeclaration(nullptr, false, ok);
case Token::CLASS:
Consume(Token::CLASS);
return impl()->ParseClassDeclaration(nullptr, false, ok);
......@@ -4309,7 +4306,7 @@ typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseStatementListItem(
default:
break;
}
return impl()->ParseStatement(nullptr, kAllowLabelledFunctionStatement, ok);
return ParseStatement(nullptr, kAllowLabelledFunctionStatement, ok);
}
template <typename Impl>
......@@ -4341,7 +4338,7 @@ typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseStatement(
// parsed into an empty statement.
switch (peek()) {
case Token::LBRACE:
return impl()->ParseBlock(labels, ok);
return ParseBlock(labels, ok);
case Token::SEMICOLON:
Next();
return factory()->NewEmptyStatement(kNoSourcePosition);
......
......@@ -960,11 +960,6 @@ class Parser : public ParserBase<Parser> {
return new (zone()) ZoneList<CaseClause*>(size, zone());
}
V8_INLINE Block* NewBlock(ZoneList<const AstRawString*>* labels, int capacity,
bool ignore_completion_value, int pos) {
return factory()->NewBlock(labels, capacity, ignore_completion_value, pos);
}
V8_INLINE Expression* NewV8Intrinsic(const AstRawString* name,
ZoneList<Expression*>* args, int pos,
bool* ok);
......
......@@ -1289,12 +1289,6 @@ class PreParser : public ParserBase<PreParser> {
return PreParserStatementList();
}
V8_INLINE static PreParserStatement NewBlock(
ZoneList<const AstRawString*>* labels, int capacity,
bool ignore_completion_value, int pos) {
return PreParserStatement::Default();
}
V8_INLINE PreParserExpression
NewV8Intrinsic(PreParserIdentifier name, PreParserExpressionList arguments,
int pos, bool* ok) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment