Index: runtime/vm/object.cc |
=================================================================== |
--- runtime/vm/object.cc (revision 20386) |
+++ runtime/vm/object.cc (working copy) |
@@ -5349,7 +5349,7 @@ |
TokenStream::Iterator::Iterator(const TokenStream& tokens, intptr_t token_pos) |
- : tokens_(tokens), |
+ : tokens_(TokenStream::Handle(tokens.raw())), |
data_(ExternalUint8Array::Handle(tokens.GetStream())), |
stream_(data_.ByteAddr(0), data_.Length()), |
token_objects_(Array::Handle(tokens.TokenObjects())), |
@@ -5361,6 +5361,20 @@ |
} |
+void TokenStream::Iterator::SetStream(const TokenStream& tokens, |
+ intptr_t token_pos) { |
+ tokens_ = tokens.raw(); |
+ data_ = tokens.GetStream(); |
+ stream_.SetStream(data_.ByteAddr(0), data_.Length()); |
+ token_objects_ = tokens.TokenObjects(); |
+ obj_ = Object::null(); |
+ cur_token_pos_ = token_pos; |
+ cur_token_kind_ = Token::kILLEGAL; |
+ cur_token_obj_index_ = -1; |
+ SetCurrentPosition(token_pos); |
+} |
+ |
+ |
bool TokenStream::Iterator::IsValid() const { |
return !tokens_.IsNull(); |
} |