-
Notifications
You must be signed in to change notification settings - Fork 218
Merge pattern regex adjustment #1964
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
base: master
Are you sure you want to change the base?
Conversation
|
Oh yes, I discovered problems with |
|
Yeah.. I have attempted to fix this before, but I never got it. I am out of idea... Also, how is If they are the same, maybe we could attempt to normalize <<{1}<<{2}<<{3}>>>>>> to <<{1}>><<{2}>><<{3}>> with a deprecation warning? Another idea I had was to change |
I believe the idea was that if {2} is missing, both {2} and {3} would be removed. Some examples:
A sort of weird idea to make this work is to substitute an uncommon literal character in a run of |
| if (m_start == -1) { | ||
| # Add safeguard instead of going in a very long loop | ||
| # rstudio/gt#1880 | ||
| cli::cli_abort("Can't resolve pattern.", .internal = TRUE) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably the only part I am satisfied with in this PR. It prevents infinite loops from happening. The rest doesn't work as intended.
Summary
2 tests are failing which I need to investigate, but opening in case you know how to fix.
Basically, the regexp was wrong in this case which caused an infinite loop. So, I added a condition which makes the case where no match occur error early. Just need to figure out why the test is failing and also how I could simplify the test.
Also needs news.
Seems like this creates problems for more than 2 <<
Should get
c("111", "2", "33", "4"), but we are erasing everything as soon as there is NA in the first column.Should get
c("111", "2", "33", "4")in the first column..Related GitHub Issues and PRs
patternmanages NAs infmt_icon() |> cols_merge(),NAgets repeatedly appended to the value. #1880Checklist
testthatunit tests totests/testthatfor any new functionality.