diff options
author | Aleksey Kladov <[email protected]> | 2018-02-04 13:46:26 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-02-04 13:46:26 +0000 |
commit | 85c42fba1291f1cc41fb7bfec63117895b394fc5 (patch) | |
tree | cda942a62d244f6352dd870cf4c4e68f739909b5 /src/parser/input.rs | |
parent | 852543212ba5c68b3428a80187087cc641de612c (diff) |
Support contextual tokens
Diffstat (limited to 'src/parser/input.rs')
-rw-r--r-- | src/parser/input.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/parser/input.rs b/src/parser/input.rs index 162b9ef5f..2ad621166 100644 --- a/src/parser/input.rs +++ b/src/parser/input.rs | |||
@@ -46,9 +46,10 @@ impl<'t> ParserInput<'t> { | |||
46 | if !(idx < self.tokens.len()) { | 46 | if !(idx < self.tokens.len()) { |
47 | return ""; | 47 | return ""; |
48 | } | 48 | } |
49 | let start_offset = self.start_offsets[idx]; | 49 | let range = TextRange::from_len( |
50 | let end_offset = self.tokens[idx].len; | 50 | self.start_offsets[idx], |
51 | let range = TextRange::from_to(start_offset, end_offset); | 51 | self.tokens[idx].len |
52 | ); | ||
52 | &self.text[range] | 53 | &self.text[range] |
53 | } | 54 | } |
54 | } | 55 | } |