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

Unified Diff: runtime/vm/scanner.cc

Issue 24359005: Make Script::GetTokenLocation() and Script::TokenRangeAtLine() use token streams where possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/scanner.cc
diff --git a/runtime/vm/scanner.cc b/runtime/vm/scanner.cc
index ecbe7097ed98badfa60553510c54b0d50a914cb6..7e36559faa6c20c36a1ff01a6257f03ab07e6d3c 100644
--- a/runtime/vm/scanner.cc
+++ b/runtime/vm/scanner.cc
@@ -895,41 +895,6 @@ void Scanner::ScanTo(intptr_t token_index) {
}
-void Scanner::TokenRangeAtLine(intptr_t line_number,
- intptr_t* first_token_index,
- intptr_t* last_token_index) {
- ASSERT(line_number > 0);
- ASSERT((first_token_index != NULL) && (last_token_index != NULL));
- Reset();
- *first_token_index = -1;
- *last_token_index = -1;
- int token_index = 0;
- do {
- Scan();
- if (current_token_.position.line >= line_number) {
- *first_token_index = token_index;
- break;
- }
- token_index++;
- } while (current_token_.kind != Token::kEOS);
- if (current_token_.kind == Token::kEOS) {
- return;
- }
- if (current_token_.position.line > line_number) {
- // *last_token_index is -1 to signal that the first token is past
- // the requested line.
- return;
- }
- ASSERT(current_token_.position.line == line_number);
- while ((current_token_.kind != Token::kEOS) &&
- (current_token_.position.line == line_number)) {
- *last_token_index = token_index;
- Scan();
- token_index++;
- }
-}
-
-
const Scanner::GrowableTokenStream& Scanner::GetStream() {
GrowableTokenStream* ts = new GrowableTokenStream(128);
ScanAll(ts);

Powered by Google App Engine
This is Rietveld 408576698