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

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

Issue 2240513003: Scanner::LiteralBuffer usage cleanup. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Feedback fix compiler issues. 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 | « no previous file | src/parsing/scanner.h » ('j') | 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 290ea993245036f1f3c35bff197a63400bbfe88a..0bb51affdc86a64f0ed9e4d270cccb78836a8cf5 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -1056,7 +1056,7 @@ class ParserBase : public Traits {
IdentifierT ParseIdentifierName(bool* ok);
- ExpressionT ParseRegExpLiteral(bool seen_equal, bool* ok);
+ ExpressionT ParseRegExpLiteral(bool* ok);
ExpressionT ParsePrimaryExpression(ExpressionClassifier* classifier,
bool* is_async, bool* ok);
@@ -1346,6 +1346,9 @@ void ParserBase<Traits>::GetUnexpectedTokenMessage(
*message = MessageTemplate::kInvalidOrUnexpectedToken;
}
break;
+ case Token::REGEXP_LITERAL:
+ *message = MessageTemplate::kUnexpectedTokenRegExp;
+ break;
default:
const char* name = Token::String(token);
DCHECK(name != NULL);
@@ -1499,9 +1502,9 @@ ParserBase<Traits>::ParseIdentifierName(bool* ok) {
template <class Traits>
typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseRegExpLiteral(
- bool seen_equal, bool* ok) {
+ bool* ok) {
int pos = peek_position();
- if (!scanner()->ScanRegExpPattern(seen_equal)) {
+ if (!scanner()->ScanRegExpPattern()) {
Next();
ReportMessage(MessageTemplate::kUnterminatedRegExp);
*ok = false;
@@ -1593,14 +1596,10 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier,
}
case Token::ASSIGN_DIV:
- classifier->RecordBindingPatternError(
- scanner()->peek_location(), MessageTemplate::kUnexpectedTokenRegExp);
- return this->ParseRegExpLiteral(true, ok);
-
case Token::DIV:
classifier->RecordBindingPatternError(
scanner()->peek_location(), MessageTemplate::kUnexpectedTokenRegExp);
- return this->ParseRegExpLiteral(false, ok);
+ return this->ParseRegExpLiteral(ok);
case Token::LBRACK:
return this->ParseArrayLiteral(classifier, ok);
« no previous file with comments | « no previous file | src/parsing/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698