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

More tests and fixes for gen lexer word boundary #275

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

klondikedragon
Copy link
Contributor

Third time's the charm!

The correct word boundary test when the position is NOT at the beginning and NOT at the end is to always test the character before the current position and the character at the current position.

In the first version, it tested the character at the current position and the next character after the current position.

In the second version, it also tested the character before the current position and the character at the current position.

The correct solution is simpler and makes sense.

Added more conformance tests to cover the changes, including more cases to ensure \b does NOT match when it should not.

Third time's the charm!

The correct word boundary test when the position is NOT at the beginning
and NOT at the end is to always test the character before the current
position and the character at the current position.

In the first version, it tested the character at the current position
and the next character after the current position.

In the second version, it also tested the character
before the current position and the character at the current position.

The correct solution is simpler and makes sense.

Added more conformance tests to cover the changes, including more cases
to ensure \b does NOT match when it should not.
@alecthomas
Copy link
Owner

Awesome :)

@alecthomas alecthomas merged commit 6ca58cf into alecthomas:master Oct 28, 2022
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.

2 participants