Commit 047d2a9
Prepare tokenizer for using borrowed strings instead of allocations.
Key points for this commit:
- The peekable trait isn't sufficient for using string slices, as we need
the byte indexes (start/end) to create string slices, so added the current
byte position to the State struct
(Note: in the long term we could potentially remove peekable and use only
the current position as an iterator)
- Created internal functions that create slices from the original query
instead of allocating strings, then converted these functions to return
String to maintain compatibility (the idea is to make a small, reviewable
commit without changing the Token struct or the parser)1 parent 58891ae commit 047d2a9
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2790 | 2790 | | |
2791 | 2791 | | |
2792 | 2792 | | |
2793 | | - | |
| 2793 | + | |
2794 | 2794 | | |
2795 | 2795 | | |
2796 | 2796 | | |
| |||
0 commit comments