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

Unified Diff: src/preparser.h

Issue 15300018: Add initial parser support for harmony iteration (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase onto current master Created 7 years, 6 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/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index e3a036f15f2836f93e269e87900e7fa1cbdca8e4..786316ed5071465e44eb46ffee7d2210ca783a0b 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -130,6 +130,7 @@ class PreParser {
allow_lazy_(false),
allow_natives_syntax_(false),
allow_generators_(false),
+ allow_for_of_(false),
parenthesized_function_(false) { }
~PreParser() {}
@@ -139,6 +140,7 @@ class PreParser {
bool allow_modules() const { return scanner_->HarmonyModules(); }
bool allow_harmony_scoping() const { return scanner_->HarmonyScoping(); }
bool allow_generators() const { return allow_generators_; }
+ bool allow_for_of() const { return allow_for_of_; }
void set_allow_natives_syntax(bool allow) { allow_natives_syntax_ = allow; }
void set_allow_lazy(bool allow) { allow_lazy_ = allow; }
@@ -147,6 +149,7 @@ class PreParser {
scanner_->SetHarmonyScoping(allow);
}
void set_allow_generators(bool allow) { allow_generators_ = allow; }
+ void set_allow_for_of(bool allow) { allow_for_of_ = allow; }
// Pre-parse the program from the character stream; returns true on
// success (even if parsing failed, the pre-parse data successfully
@@ -655,6 +658,8 @@ class PreParser {
}
void ExpectSemicolon(bool* ok);
+ bool CheckInOrOf();
+
static int Precedence(i::Token::Value tok, bool accept_IN);
void SetStrictModeViolation(i::Scanner::Location,
@@ -678,6 +683,7 @@ class PreParser {
bool allow_lazy_;
bool allow_natives_syntax_;
bool allow_generators_;
+ bool allow_for_of_;
bool parenthesized_function_;
};
} } // v8::preparser
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698