Skip to content
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

Provide character- instead of byte-based indices ... #73

Merged
merged 1 commit into from
Nov 24, 2020

Conversation

jaynetics
Copy link
Collaborator

Ragel runs with byte-based indices (ts, te). These are of little value to end-users, so I suggest we keep track of char-based indices and emit those instead.

c.f. #72

Ragel runs with byte-based indices (ts, te). These are of little value to end-users, so I suggest we keep track of char-based indices and emit those instead.

c.f. #72
@@ -797,22 +798,29 @@ class Regexp::Scanner
end

# Emits an array with the details of the scanned pattern
def emit(type, token, text, ts, te)
def emit(type, token, text)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Char indices are now tracked in this method, hence why ts, te no longer need to be passed

@jaynetics jaynetics merged commit fd1e058 into master Nov 24, 2020
@jaynetics jaynetics deleted the use_character_indices branch November 24, 2020 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant