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

Unified Diff: src/parsing/parser-base.h

Issue 2275313002: [parser] Eliminate ExpressionClassifier::MergeNonPatterns (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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index 205c0eec49753243854667103f1a05c16a854884..0925b4d45d169aeff881848461b6a2241c808400 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -2381,7 +2381,6 @@ ParserBase<Impl>::ParseAssignmentExpression(bool accept_IN,
// form part of one. Propagate speculative formal parameter error locations
// (including those for binding patterns, since formal parameters can
// themselves contain binding patterns).
- // Do not merge pending non-pattern expressions yet!
unsigned productions = ExpressionClassifier::AllProductions &
~ExpressionClassifier::ArrowFormalParametersProduction;
@@ -2402,18 +2401,16 @@ ParserBase<Impl>::ParseAssignmentExpression(bool accept_IN,
ExpressionClassifier::TailCallExpressionProduction);
}
- classifier->Accumulate(&arrow_formals_classifier, productions, false);
-
if (!Token::IsAssignmentOp(peek())) {
// Parsed conditional expression only (no assignment).
- // Now pending non-pattern expressions must be merged.
- classifier->MergeNonPatterns(&arrow_formals_classifier);
+ // Pending non-pattern expressions must be merged.
+ classifier->Accumulate(&arrow_formals_classifier, productions);
return expression;
+ } else {
+ // Pending non-pattern expressions must be discarded.
+ classifier->Accumulate(&arrow_formals_classifier, productions, false);
}
- // Now pending non-pattern expressions must be discarded.
- arrow_formals_classifier.Discard();
-
CheckNoTailCallExpressions(classifier, CHECK_OK);
if (is_destructuring_assignment) {
« no previous file with comments | « src/parsing/expression-classifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698