-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convenience: method to get current token from iterator #4
Comments
Maybe the iterator should always be of the string slices, with the understanding that the iterator is an extra convenience thing, on top of the lower-level imperative API based on |
The strings aren't useful without the type so you'd need a (substring, type) tuple of some sort.
|
The next method does this. |
In every example I've written using this (like this one) I end up with this pattern:
i.e. I need to maintain
pos
tracking the previous index and slice the string myself. How about:%SegmentIterator%.prototype.segment
Return a substring of the input string from last index to the current index.
...so you can just write:
The text was updated successfully, but these errors were encountered: