Skip to content

Feature/add support for negation operator#94

Merged
Saibo-creator merged 4 commits into
epfl-dlab:mainfrom
nathanrchn:feature/add-support-for-negation-operator
Sep 19, 2024
Merged

Feature/add support for negation operator#94
Saibo-creator merged 4 commits into
epfl-dlab:mainfrom
nathanrchn:feature/add-support-for-negation-operator

Conversation

@nathanrchn

Copy link
Copy Markdown
Contributor

This PR adds support for the negation operator. It only supports negative ranges for now.

To do so, I proceeded as follows: for a given negative range [a, b], the allowed range is: [0, a - 1] U [b + 1, max_ord].
I set the max_ord to 0xFF but I think it's better to support unicode chars too. But if I set it to 0xFFFF, it will be the same value as the END_OF_GRAMMAR_MARKER constant. So maybe the best thing is to set END_OF_GRAMMAR_MARKER to 0xFFFFF?

@Saibo-creator

Saibo-creator commented Sep 15, 2024

Copy link
Copy Markdown
Collaborator

@nathanrchn Could you add a unit test for this feature in the tests/ folder?

P.S. If I didn’t mention it before, running pre-commit install(only once ) will automatically run all test cases whenver you try to make a commit and perform a series of sanity check. It will help you to spot some hidden issues from refactoring :)

@Saibo-creator
Saibo-creator merged commit 24194a9 into epfl-dlab:main Sep 19, 2024
@nathanrchn
nathanrchn deleted the feature/add-support-for-negation-operator branch September 19, 2024 06:36
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