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

Unified Diff: src/lexer/experimental-scanner.h

Issue 98863002: Experimental scanner: fix harmony flag setting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years 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/lexer/lexer-shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lexer/experimental-scanner.h
diff --git a/src/lexer/experimental-scanner.h b/src/lexer/experimental-scanner.h
index ab07ef62e5bda4f91e33e2225421777452ce0912..b85aa770befa19715e420f7d4ef9dfa44b9e1abe 100644
--- a/src/lexer/experimental-scanner.h
+++ b/src/lexer/experimental-scanner.h
@@ -88,6 +88,29 @@ class ScannerBase {
}
}
+ // Has to be called after creating the scanner and setting the flags.
+ virtual void Init() = 0;
+
+ // Seek forward to the given position. This operation works for simple cases
+ // such as seeking forward until simple delimiter tokens, which is what it is
+ // used for. After this call, we will have the token at the given position as
+ // the "next" token. The "current" token will be invalid. FIXME: for utf-8,
+ // we need to decide if pos is counted in characters or in bytes.
+ virtual void SeekForward(int pos) = 0;
+ virtual void SetEnd(int pos) = 0;
+
+ // Scans the input as a regular expression pattern, previous character(s) must
+ // be /(=). Returns true if a pattern is scanned. FIXME: this won't work for
+ // utf-8 newlines.
+ virtual bool ScanRegExpPattern(bool seen_equal) = 0;
+ // Returns true if regexp flags are scanned (always since flags can
+ // be empty).
+ virtual bool ScanRegExpFlags() = 0;
+
+ // Returns the location of the last seen octal literal.
+ virtual Location octal_position() const = 0;
+ virtual void clear_octal_position() = 0;
+
// Returns the next token and advances input.
Token::Value Next() {
has_line_terminator_before_next_ = false;
@@ -217,26 +240,6 @@ class ScannerBase {
(memcmp(literal.start(), keyword.start(), literal.length()) == 0);
}
- // Seek forward to the given position. This operation works for simple cases
- // such as seeking forward until simple delimiter tokens, which is what it is
- // used for. After this call, we will have the token at the given position as
- // the "next" token. The "current" token will be invalid. FIXME: for utf-8,
- // we need to decide if pos is counted in characters or in bytes.
- virtual void SeekForward(int pos) = 0;
- virtual void SetEnd(int pos) = 0;
-
- // Scans the input as a regular expression pattern, previous character(s) must
- // be /(=). Returns true if a pattern is scanned. FIXME: this won't work for
- // utf-8 newlines.
- virtual bool ScanRegExpPattern(bool seen_equal) = 0;
- // Returns true if regexp flags are scanned (always since flags can
- // be empty).
- virtual bool ScanRegExpFlags() = 0;
-
- // Returns the location of the last seen octal literal.
- virtual Location octal_position() const = 0;
- virtual void clear_octal_position() = 0;
-
protected:
struct TokenDesc {
Token::Value token;
@@ -299,6 +302,9 @@ class ExperimentalScanner : public ScannerBase {
last_octal_end_(NULL) {
ASSERT(source->IsFlat());
SetBufferBasedOnHandle();
+ }
+
+ virtual void Init() {
Scan();
}
« no previous file with comments | « no previous file | src/lexer/lexer-shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698