Commit 9563acd3 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[parser] Simplify ExpectSemicolon

Change-Id: I1551da2cbd5cbd6e0cdf86837a01c84217a648b6
Reviewed-on: https://chromium-review.googlesource.com/1190783Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55433}
parent aab50a31
......@@ -752,22 +752,14 @@ class ParserBase {
return;
}
Token::Value current = scanner()->current_token();
Scanner::Location current_location = scanner()->location();
Token::Value next = Next();
if (next == Token::SEMICOLON) {
return;
}
*ok = false;
if (current == Token::AWAIT && !is_async_function()) {
ReportMessageAt(current_location,
if (scanner()->current_token() == Token::AWAIT && !is_async_function()) {
ReportMessageAt(scanner()->location(),
MessageTemplate::kAwaitNotInAsyncFunction, kSyntaxError);
return;
}
ReportUnexpectedToken(next);
ReportUnexpectedToken(Next());
}
// Dummy functions, just useful as arguments to CHECK_OK_CUSTOM.
......
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