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

Unified Diff: src/scanner.h

Issue 9352013: Extend scanner with new Harmony module keywords (under flag). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « src/preparser.h ('k') | src/scanner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner.h
diff --git a/src/scanner.h b/src/scanner.h
index c512ec3fefb68c6ecc858b2351d62dfbd134e046..a1a377f653829e7a82d45235dd2bb741aaef612d 100644
--- a/src/scanner.h
+++ b/src/scanner.h
@@ -52,7 +52,8 @@ enum ParsingFlags {
// EXTENDED_MODE,
kLanguageModeMask = 0x03,
kAllowLazy = 4,
- kAllowNativesSyntax = 8
+ kAllowNativesSyntax = 8,
+ kAllowModules = 16
Michael Starzinger 2012/02/07 14:50:59 Can we either change this constant (and the two ab
rossberg 2012/02/08 10:32:42 Done.
};
STATIC_ASSERT((kLanguageModeMask & CLASSIC_MODE) == CLASSIC_MODE);
@@ -403,8 +404,14 @@ class Scanner {
bool HarmonyScoping() const {
return harmony_scoping_;
}
- void SetHarmonyScoping(bool block_scoping) {
- harmony_scoping_ = block_scoping;
+ void SetHarmonyScoping(bool scoping) {
+ harmony_scoping_ = scoping;
+ }
+ bool HarmonyModules() const {
+ return harmony_modules_;
+ }
+ void SetHarmonyModules(bool modules) {
+ harmony_modules_ = modules;
}
@@ -552,9 +559,10 @@ class Scanner {
// Whether there is a multi-line comment that contains a
// line-terminator after the current token, and before the next.
bool has_multiline_comment_before_next_;
- // Whether we scan 'let' as a keyword for harmony block scoped
- // let bindings.
+ // Whether we scan 'let' as a keyword for harmony block-scoped let bindings.
bool harmony_scoping_;
+ // Whether we scan 'module', 'import', 'export', and 'from' as keywords.
Michael Starzinger 2012/02/07 14:50:59 I don't see "from" being a keyword in the scanner.
rossberg 2012/02/08 10:32:42 Oops, leftover.
+ bool harmony_modules_;
};
} } // namespace v8::internal
« no previous file with comments | « src/preparser.h ('k') | src/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698