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

Unified Diff: src/lexer/lexer.cc

Issue 200323005: Experimental parser: fix generated lexer build after merge (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 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/lexer/lexer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lexer/lexer.cc
diff --git a/src/lexer/lexer.cc b/src/lexer/lexer.cc
index 0a8744276cd8f2b7e8c5b1d3ccf2ecedfa85bb29..f43f253723bfd589ee41917f189c9bd5558e56b0 100644
--- a/src/lexer/lexer.cc
+++ b/src/lexer/lexer.cc
@@ -29,6 +29,7 @@
#include "lexer.h"
#include "char-predicates-inl.h"
#include "scanner-character-streams.h"
+#include "parser.h"
namespace v8 {
namespace internal {
@@ -526,6 +527,59 @@ void LexerBase::LiteralDesc::SetStringFromLiteralBuffer() {
}
+Handle<String> LexerBase::AllocateNextLiteralString(Isolate* isolate,
+ PretenureFlag tenured) {
+ if (is_next_literal_one_byte()) {
+ return isolate->factory()->NewStringFromOneByte(
+ Vector<const uint8_t>::cast(next_literal_one_byte_string()), tenured);
+ } else {
+ return isolate->factory()->NewStringFromTwoByte(
+ next_literal_two_byte_string(), tenured);
+ }
+}
+
+
+Handle<String> LexerBase::AllocateInternalizedString(Isolate* isolate) {
+ if (is_literal_one_byte()) {
+ return isolate->factory()->InternalizeOneByteString(
+ literal_one_byte_string());
+ } else {
+ return isolate->factory()->InternalizeTwoByteString(
+ literal_two_byte_string());
+ }
+}
+
+
+double LexerBase::DoubleValue() {
+ ASSERT(is_literal_one_byte());
+ return StringToDouble(
+ unicode_cache_, Vector<const char>::cast(literal_one_byte_string()),
+ ALLOW_HEX | ALLOW_OCTAL | ALLOW_IMPLICIT_OCTAL | ALLOW_BINARY);
+}
+
+
+int LexerBase::FindNumber(DuplicateFinder* finder, int value) {
+ return finder->AddNumber(literal_one_byte_string(), value);
+}
+
+
+int LexerBase::FindSymbol(DuplicateFinder* finder, int value) {
+ if (is_literal_one_byte()) {
+ return finder->AddOneByteSymbol(literal_one_byte_string(), value);
+ }
+ return finder->AddTwoByteSymbol(literal_two_byte_string(), value);
+}
+
+
+void LexerBase::LogSymbol(ParserRecorder* log, int position) {
+ if (is_literal_one_byte()) {
+ log->LogOneByteSymbol(position, literal_one_byte_string());
+ } else {
+ log->LogTwoByteSymbol(position, literal_two_byte_string());
+ }
+}
+
+
static inline bool IsOneByte(const uint8_t* cursor, const uint8_t* end) {
return true;
}
« no previous file with comments | « src/lexer/lexer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698