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]; |