Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 1fcbdb078b7d49285b5c5bea5664e2b39b3a753b..032733222dddb4b474a3e2fce2f5f0d06566c3cb 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -8592,7 +8592,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) { |
@@ -8614,6 +8615,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; |
rmacnak
2015/09/03 00:55:19
Maybe otherwise keyword length?
turnidge
2015/09/04 18:05:29
My hope was that the literal pointed to the keywor
|
+ } |
+ } |
// On the first line of the script we must add the column offset. |
if (relative_line == 1) { |
*column += col_offset(); |