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

Unified Diff: src/parser.h

Issue 156423005: Move ParseRegexpLiteral to ParserBase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code review (ulan) Created 6 years, 10 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/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index 64513d3569aed421f374a128078aa62e440b1ccb..c2dd77fe2a090120213bca045581876e78ac8448 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -412,6 +412,7 @@ class ParserTraits {
typedef Parser* ParserType;
// Return types for traversing functions.
typedef Handle<String> IdentifierType;
+ typedef Expression* ExpressionType;
explicit ParserTraits(Parser* parser) : parser_(parser) {}
@@ -419,6 +420,7 @@ class ParserTraits {
bool is_classic_mode() const;
bool is_generator() const;
bool IsEvalOrArguments(Handle<String> identifier) const;
+ int NextMaterializedLiteralIndex();
// Reporting errors.
void ReportMessageAt(Scanner::Location source_location,
@@ -429,12 +431,21 @@ class ParserTraits {
const char* message,
Vector<Handle<String> > args);
- // Identifiers:
+ // "null" return type creators.
static IdentifierType EmptyIdentifier() {
return Handle<String>();
}
+ static ExpressionType EmptyExpression() {
+ return NULL;
+ }
+ // Producing data during the recursive descent.
IdentifierType GetSymbol();
+ IdentifierType NextLiteralString(PretenureFlag tenured);
+ ExpressionType NewRegExpLiteral(IdentifierType js_pattern,
+ IdentifierType js_flags,
+ int literal_index,
+ int pos);
private:
Parser* parser_;
@@ -657,7 +668,6 @@ class Parser : public ParserBase<ParserTraits> {
Expression* ParsePrimaryExpression(bool* ok);
Expression* ParseArrayLiteral(bool* ok);
Expression* ParseObjectLiteral(bool* ok);
- Expression* ParseRegExpLiteral(bool seen_equal, bool* ok);
// Initialize the components of a for-in / for-of statement.
void InitializeForEachStatement(ForEachStatement* stmt,
@@ -690,16 +700,6 @@ class Parser : public ParserBase<ParserTraits> {
}
}
- Handle<String> NextLiteralString(PretenureFlag tenured) {
- if (scanner().is_next_literal_ascii()) {
- return isolate_->factory()->NewStringFromAscii(
- scanner().next_literal_ascii_string(), tenured);
- } else {
- return isolate_->factory()->NewStringFromTwoByte(
- scanner().next_literal_utf16_string(), tenured);
- }
- }
-
// Get odd-ball literals.
Literal* GetLiteralUndefined(int position);
Literal* GetLiteralTheHole(int position);
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698