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

Unified Diff: src/parsing/parser.h

Issue 2289663002: [parser] Hide expression classifiers in parser implementation (Closed)
Patch Set: Rebase Created 4 years, 4 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/expression-classifier.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index afecebde1e778911a6d7b6d03b04e2b2dbc20f63..7ff5fb2415d5c4cd20401b57cad235d1eeeb911a 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -146,9 +146,6 @@ struct ParserTypes<Parser> {
typedef v8::internal::AstProperties AstProperties;
- typedef v8::internal::ExpressionClassifier<ParserTypes<Parser>>
- ExpressionClassifier;
-
// Return types for traversing functions.
typedef const AstRawString* Identifier;
typedef v8::internal::Expression* Expression;
@@ -444,7 +441,6 @@ class Parser : public ParserBase<Parser> {
void DesugarAsyncFunctionBody(const AstRawString* function_name, Scope* scope,
ZoneList<Statement*>* body,
- ExpressionClassifier* classifier,
FunctionKind kind, FunctionBodyType type,
bool accept_IN, int pos, bool* ok);
@@ -456,8 +452,7 @@ class Parser : public ParserBase<Parser> {
int function_token_position, FunctionLiteral::FunctionType type,
LanguageMode language_mode, bool* ok);
- Expression* ParseClassLiteral(ExpressionClassifier* classifier,
- const AstRawString* name,
+ Expression* ParseClassLiteral(const AstRawString* name,
Scanner::Location class_name_location,
bool name_is_strict_reserved, int pos,
bool* ok);
@@ -579,12 +574,10 @@ class Parser : public ParserBase<Parser> {
void ParseAsyncArrowSingleExpressionBody(ZoneList<Statement*>* body,
bool accept_IN,
- ExpressionClassifier* classifier,
int pos, bool* ok) {
- DesugarAsyncFunctionBody(ast_value_factory()->empty_string(), scope(), body,
- classifier, kAsyncArrowFunction,
- FunctionBodyType::kSingleExpression, accept_IN,
- pos, ok);
+ DesugarAsyncFunctionBody(
+ ast_value_factory()->empty_string(), scope(), body, kAsyncArrowFunction,
+ FunctionBodyType::kSingleExpression, accept_IN, pos, ok);
}
ZoneList<Expression*>* PrepareSpreadArguments(ZoneList<Expression*>* list);
@@ -611,7 +604,7 @@ class Parser : public ParserBase<Parser> {
V8_INLINE Expression* RewriteSpreads(ArrayLiteral* lit);
// Rewrite expressions that are not used as patterns
- V8_INLINE void RewriteNonPattern(ExpressionClassifier* classifier, bool* ok);
+ V8_INLINE void RewriteNonPattern(bool* ok);
V8_INLINE void QueueDestructuringAssignmentForRewriting(
Expression* assignment);
@@ -953,10 +946,9 @@ class Parser : public ParserBase<Parser> {
V8_INLINE void DeclareFormalParameter(
DeclarationScope* scope,
- const ParserFormalParameters::Parameter& parameter,
- ExpressionClassifier* classifier) {
+ const ParserFormalParameters::Parameter& parameter) {
bool is_duplicate = false;
- bool is_simple = classifier->is_simple_parameter_list();
+ bool is_simple = classifier()->is_simple_parameter_list();
auto name = is_simple || parameter.is_rest
? parameter.name
: ast_value_factory()->empty_string();
@@ -967,7 +959,7 @@ class Parser : public ParserBase<Parser> {
scope->DeclareParameter(name, mode, is_optional, parameter.is_rest,
&is_duplicate, ast_value_factory());
if (is_duplicate) {
- classifier->RecordDuplicateFormalParameterError(scanner()->location());
+ classifier()->RecordDuplicateFormalParameterError(scanner()->location());
}
if (is_sloppy(scope->language_mode())) {
// TODO(sigurds) Mark every parameter as maybe assigned. This is a
« no previous file with comments | « src/parsing/expression-classifier.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698