Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 86d461ac28b466c3ba800752a4cfa955947de53c..f2be209f4ffa801fad83aa002e621df40c25aa8d 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -8593,7 +8593,8 @@ void Script::SetLocationOffset(intptr_t line_offset, |
void Script::GetTokenLocation(intptr_t token_pos, |
intptr_t* line, |
- intptr_t* column) const { |
+ intptr_t* column, |
+ intptr_t* token_len) const { |
ASSERT(line != NULL); |
const TokenStream& tkns = TokenStream::Handle(tokens()); |
if (column == NULL) { |
@@ -8615,6 +8616,13 @@ void Script::GetTokenLocation(intptr_t token_pos, |
intptr_t relative_line = scanner.CurrentPosition().line; |
*line = relative_line + line_offset(); |
*column = scanner.CurrentPosition().column; |
+ if (token_len != NULL) { |
+ if (scanner.current_token().literal != NULL) { |
+ *token_len = scanner.current_token().literal->Length(); |
+ } else { |
+ *token_len = 1; |
+ } |
+ } |
// On the first line of the script we must add the column offset. |
if (relative_line == 1) { |
*column += col_offset(); |