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

Rewrote squeeze to avoid commons-lang dependency #1992

Merged
merged 8 commits into from
Jul 17, 2024

Conversation

DavyLandman
Copy link
Member

@DavyLandman DavyLandman commented Jul 2, 2024

I noticed we still had a commons-lang dependency. I thought we got rid of that 10y back when most of their string functions weren't safe for unicode.

There was on function still using it, so I rewrote that in regular rascal. I see no reasson to keep this in Java, unless it becomes a bottleneck.

And I added tests for it (that I first tested on the original code).

Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49%. Comparing base (cfa4c57) to head (47c7ac9).

Additional details and impacted files
@@           Coverage Diff           @@
##              main   #1992   +/-   ##
=======================================
  Coverage       49%     49%           
- Complexity    6306    6313    +7     
=======================================
  Files          664     664           
  Lines        59586   59601   +15     
  Branches      8643    8646    +3     
=======================================
+ Hits         29475   29484    +9     
  Misses       27900   27900           
- Partials      2211    2217    +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DavyLandman DavyLandman force-pushed the chore/remove-commons-lang-dependency branch from 07662e2 to 274e623 Compare July 16, 2024 09:45
@DavyLandman
Copy link
Member Author

@jurgenvinju I've rewritten it back in java.

Copy link
Member

@jurgenvinju jurgenvinju left a comment

Choose a reason for hiding this comment

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

Nice fix!

It's strange that we use strings for character classes while the concept is built-in to our type system. We could use #[a-z0-9] as a an actual parameter instead of a string for good measure. The formal parameter would be type[![]] class so any subset of the full Unicode 24 table. Shall we do that in another PR?

@DavyLandman
Copy link
Member Author

Agreed, this function is strange to begin with. it was added 11y ago, and I cannot find a place where it's used.

@DavyLandman DavyLandman merged commit 6c2e1b9 into main Jul 17, 2024
7 checks passed
@jurgenvinju jurgenvinju deleted the chore/remove-commons-lang-dependency branch July 17, 2024 08:30
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