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

Unified Diff: src/scanner-character-streams.h

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: 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 | « src/scanner.cc ('k') | src/scanner-character-streams.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner-character-streams.h
diff --git a/src/scanner-character-streams.h b/src/scanner-character-streams.h
index 319ee8fc1c587f82487b8e402250914adb2dcee2..9ea0d43b516d8dcf399f175fdddd30b66c635631 100644
--- a/src/scanner-character-streams.h
+++ b/src/scanner-character-streams.h
@@ -33,6 +33,10 @@
namespace v8 {
namespace internal {
+
+#ifndef V8_USE_GENERATED_LEXER
+
+
// A buffered character stream based on a random access character
// source (ReadBlock can be called with pos_ pointing to any position,
// even positions before the current).
@@ -124,6 +128,57 @@ class ExternalTwoByteStringUtf16CharacterStream: public Utf16CharacterStream {
const uc16* raw_data_; // Pointer to the actual array of characters.
};
+
+#else
+
+
+class Utf8ToUtf16CharacterStream: public Utf16CharacterStream {
+ public:
+ Utf8ToUtf16CharacterStream(const byte* data, unsigned length)
+ : Utf16CharacterStream(kUtf8ToUtf16),
+ data_(reinterpret_cast<const int8_t*>(data)),
+ length_(length) {}
+
+ const int8_t* const data_;
+ const unsigned length_;
+};
+
+
+class GenericStringUtf16CharacterStream: public Utf16CharacterStream {
+ public:
+ GenericStringUtf16CharacterStream(Handle<String> data,
+ unsigned start_position,
+ unsigned end_position)
+ : Utf16CharacterStream(kGenericStringUtf16),
+ data_(data),
+ start_position_(start_position),
+ end_position_(end_position) {}
+
+ const Handle<String> data_;
+ const unsigned start_position_;
+ const unsigned end_position_;
+};
+
+
+class ExternalTwoByteStringUtf16CharacterStream: public Utf16CharacterStream {
+ public:
+ ExternalTwoByteStringUtf16CharacterStream(Handle<ExternalTwoByteString> data,
+ int start_position,
+ int end_position)
+ : Utf16CharacterStream(kExternalTwoByteStringUtf16),
+ data_(data),
+ start_position_(start_position),
+ end_position_(end_position) {}
+
+ const Handle<ExternalTwoByteString> data_;
+ const int start_position_;
+ const int end_position_;
+};
+
+
+#endif
+
+
} } // namespace v8::internal
#endif // V8_SCANNER_CHARACTER_STREAMS_H_
« no previous file with comments | « src/scanner.cc ('k') | src/scanner-character-streams.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698