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

Fixing shortcut expansion bug caused by equality comparison between InputByte and InputMultiByteSet #101

Merged
merged 1 commit into from
May 25, 2023

Conversation

jonessha
Copy link
Contributor

Description of changes:

The bug occurred when a shortcut transition existed, then an equals-ignore-case rule gets added and tries to expand the shortcut. This logic involves an equals comparison between each InputCharacter from the original value added and the current value added. This occurs on ByteMachine line 1402. Since a shortcut transition came from an exact match, it will be represented by InputBytes, where as the equals-ignore-case match will be represented by InputMultiByteSets. This means the equality check will always return false. I considered changing the equality checks to allow a single byte InputMultiByteSet to equal an InputByte, but that would be a misleading equals implementation. Instead, I changed the equals-ignore-case parser to parse into InputBytes when lower and upper case representations are the same.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@baldawar baldawar merged commit 771c096 into main May 25, 2023
3 checks passed
@jonessha jonessha deleted the equals-ignore-case-bug-fix branch May 25, 2023 18:22
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.

None yet

2 participants