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

Unified Diff: src/parsing/preparser.cc

Issue 2274113002: [parser] Clean up (pre)parser traits, part 4 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/preparser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index 9fa94a362e4085e10b3eba3ef77de059af11b500..461e853bbc7dbc869fb2f79da36d9784199bafa6 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -41,9 +41,8 @@ namespace internal {
#define DUMMY ) // to make indentation work
#undef DUMMY
-PreParserIdentifier ParserBaseTraits<PreParser>::GetSymbol(
- Scanner* scanner) const {
- switch (scanner->current_token()) {
+PreParserIdentifier PreParser::GetSymbol() const {
+ switch (scanner()->current_token()) {
case Token::ENUM:
return PreParserIdentifier::Enum();
case Token::AWAIT:
@@ -59,28 +58,20 @@ PreParserIdentifier ParserBaseTraits<PreParser>::GetSymbol(
case Token::ASYNC:
return PreParserIdentifier::Async();
default:
- if (scanner->UnescapedLiteralMatches("eval", 4))
+ if (scanner()->UnescapedLiteralMatches("eval", 4))
return PreParserIdentifier::Eval();
- if (scanner->UnescapedLiteralMatches("arguments", 9))
+ if (scanner()->UnescapedLiteralMatches("arguments", 9))
return PreParserIdentifier::Arguments();
- if (scanner->UnescapedLiteralMatches("undefined", 9))
+ if (scanner()->UnescapedLiteralMatches("undefined", 9))
return PreParserIdentifier::Undefined();
- if (scanner->LiteralMatches("prototype", 9))
+ if (scanner()->LiteralMatches("prototype", 9))
return PreParserIdentifier::Prototype();
- if (scanner->LiteralMatches("constructor", 11))
+ if (scanner()->LiteralMatches("constructor", 11))
return PreParserIdentifier::Constructor();
return PreParserIdentifier::Default();
}
}
-PreParserExpression ParserBaseTraits<PreParser>::ExpressionFromString(
- int pos, Scanner* scanner, PreParserFactory* factory) const {
- if (scanner->UnescapedLiteralMatches("use strict", 10)) {
- return PreParserExpression::UseStrictStringLiteral();
- }
- return PreParserExpression::StringLiteral();
-}
-
PreParser::PreParseResult PreParser::PreParseLazyFunction(
LanguageMode language_mode, FunctionKind kind, bool has_simple_parameters,
bool parsing_module, ParserRecorder* log, Scanner::BookmarkScope* bookmark,
« no previous file with comments | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698