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

[parser] Shortcut identifier assignment parsing

Shortcuts allow identifiable primary expressions to bypass all productions
starting from assignment expression. We can identify them by looking at the
token after the single token of which the primary expression consists. This CL
adds support for 'identifier' followed by '=' as a primary LHS.

Change-Id: I2f1939a39e03384598359a3a39e1d6cef9967e21
Reviewed-on: https://chromium-review.googlesource.com/1252805Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56306}
parent f4d0d7e9
......@@ -4325,7 +4325,8 @@ bool ParserBase<Impl>::IsTrivialExpression() {
// peek().
Token::Value peek_ahead = PeekAhead();
if (peek_ahead == Token::COMMA || peek_ahead == Token::RPAREN ||
peek_ahead == Token::SEMICOLON || peek_ahead == Token::RBRACK) {
peek_ahead == Token::SEMICOLON || peek_ahead == Token::RBRACK ||
Token::IsAssignmentOp(peek_ahead)) {
return true;
}
}
......
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