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

Unified Diff: runtime/vm/object.cc

Issue 36323003: - Ensure that the token stream from generated source matches the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 28974)
+++ runtime/vm/object.cc (working copy)
@@ -6233,7 +6233,7 @@
intptr_t TokenStream::ComputeSourcePosition(intptr_t tok_pos) const {
- Iterator iterator(*this, 0);
+ Iterator iterator(*this, 0, Iterator::kAllTokens);
intptr_t src_pos = 0;
Token::Kind kind = iterator.CurrentTokenKind();
while (iterator.CurrentPosition() < tok_pos && kind != Token::kEOS) {
@@ -6245,19 +6245,6 @@
}
-intptr_t TokenStream::ComputeTokenPosition(intptr_t src_pos) const {
- Iterator iterator(*this, 0);
- intptr_t index = 0;
- Token::Kind kind = iterator.CurrentTokenKind();
- while (index < src_pos && kind != Token::kEOS) {
- iterator.Advance();
- kind = iterator.CurrentTokenKind();
- index += 1;
- }
- return iterator.CurrentPosition();
-}
-
-
RawTokenStream* TokenStream::New() {
ASSERT(Object::token_stream_class() != Class::null());
RawObject* raw = Object::Allocate(TokenStream::kClassId,
@@ -6302,7 +6289,7 @@
}
// Add an IDENT token into the stream and the token objects array.
- void AddIdentToken(String* ident) {
+ void AddIdentToken(const String* ident) {
if (ident != NULL) {
// If the IDENT token is already in the tokens object array use the
// same index instead of duplicating it.
@@ -6320,7 +6307,7 @@
}
// Add a LITERAL token into the stream and the token objects array.
- void AddLiteralToken(Token::Kind kind, String* literal) {
+ void AddLiteralToken(Token::Kind kind, const String* literal) {
if (literal != NULL) {
// If the literal token is already in the tokens object array use the
// same index instead of duplicating it.
@@ -6355,7 +6342,7 @@
}
private:
- intptr_t FindIdentIndex(String* ident) {
+ intptr_t FindIdentIndex(const String* ident) {
ASSERT(ident != NULL);
intptr_t hash_value = ident->Hash() % kTableSize;
GrowableArray<intptr_t>& value = ident_table_[hash_value];
@@ -6373,7 +6360,7 @@
return -1;
}
- intptr_t FindLiteralIndex(Token::Kind kind, String* literal) {
+ intptr_t FindLiteralIndex(Token::Kind kind, const String* literal) {
ASSERT(literal != NULL);
intptr_t hash_value = literal->Hash() % kTableSize;
GrowableArray<intptr_t>& value = literal_table_[hash_value];
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | runtime/vm/scanner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698