Commit 88053717 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[parser] Only look through RewritableExpression to check Assignment

RewritableExpression always contain Assignment until rewriting; which
we only do after parsing a function. We don't call ->Is on possibly
rewritten expressions afterwards (we'll simply visit them instead).

Change-Id: I3be91e9f6701994a571d280515c9da34257f5425
Reviewed-on: https://chromium-review.googlesource.com/c/1291071Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56821}
parent 24767d76
......@@ -3362,7 +3362,7 @@ class AstNodeFactory final {
bool AstNode::Is##type() const { \
NodeType mine = node_type(); \
if (mine == AstNode::kRewritableExpression && \
AstNode::k##type != AstNode::kRewritableExpression) \
AstNode::k##type == AstNode::kAssignment) \
mine = reinterpret_cast<const RewritableExpression*>(this) \
->expression() \
->node_type(); \
......@@ -3372,7 +3372,7 @@ class AstNodeFactory final {
NodeType mine = node_type(); \
AstNode* result = this; \
if (mine == AstNode::kRewritableExpression && \
AstNode::k##type != AstNode::kRewritableExpression) { \
AstNode::k##type == AstNode::kAssignment) { \
result = \
reinterpret_cast<const RewritableExpression*>(this)->expression(); \
mine = result->node_type(); \
......
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