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

Unified Diff: src/scanner-base.h

Issue 5026005: Move static scanner fields to scanner-base.h (Closed)
Patch Set: Created 10 years, 1 month 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/scanner.cc ('k') | src/scanner-base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner-base.h
diff --git a/src/scanner-base.h b/src/scanner-base.h
index 500870b5759ee03266030ffed882854c30829424..72797a8945d644f4581057c3c0ca2c181756b1e9 100644
--- a/src/scanner-base.h
+++ b/src/scanner-base.h
@@ -30,12 +30,37 @@
#ifndef V8_SCANNER_BASE_H_
#define V8_SCANNER_BASE_H_
+#include "globals.h"
+#include "checks.h"
+#include "allocation.h"
#include "token.h"
-#include "unicode.h"
+#include "unicode-inl.h"
+#include "char-predicates.h"
+#include "utils.h"
namespace v8 {
namespace internal {
+class ScannerConstants : AllStatic {
+ public:
+ typedef unibrow::Utf8InputBuffer<1024> Utf8Decoder;
+
+ static StaticResource<Utf8Decoder>* utf8_decoder() {
+ return &utf8_decoder_;
+ }
+
+ static unibrow::Predicate<IdentifierStart, 128> kIsIdentifierStart;
+ static unibrow::Predicate<IdentifierPart, 128> kIsIdentifierPart;
+ static unibrow::Predicate<unibrow::LineTerminator, 128> kIsLineTerminator;
+ static unibrow::Predicate<unibrow::WhiteSpace, 128> kIsWhiteSpace;
+
+ static bool IsIdentifier(unibrow::CharacterStream* buffer);
+
+ private:
+ static StaticResource<Utf8Decoder> utf8_decoder_;
+};
+
+
class KeywordMatcher {
// Incrementally recognize keywords.
//
@@ -45,7 +70,8 @@ class KeywordMatcher {
// return switch this throw true try typeof var void while with
//
// *: Actually "future reserved keywords". These are the only ones we
-// recognized, the remaining are allowed as identifiers.
+// recognize, the remaining are allowed as identifiers.
+// In ES5 strict mode, we should disallow all reserved keywords.
public:
KeywordMatcher()
: state_(INITIAL),
@@ -156,10 +182,6 @@ class KeywordMatcher {
};
-
-
-
-
} } // namespace v8::internal
#endif // V8_SCANNER_BASE_H_
« no previous file with comments | « src/scanner.cc ('k') | src/scanner-base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698