-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Ruby/Python: regex parser: group sequences of 'normal' characters #8166
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
Conversation
053a7d6
to
11c1633
Compare
11c1633
to
69ed121
Compare
@yoff Could you have a look at this? |
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.
Great to see this, thanks for doing it!
I believe that what you are doing, is changing character
from being either a simpleCharacter
or an escapedCharacter
to now being either a maximal simpleCharacter
run or an escapedCharacter
. I have therefor suggested to rename some of the predicates.
I also wonder if the computation of maximal runs is standard or if a more efficient one might exist, but if the performance looks fine, then we can punt this question.
| ax{01,3} | first | 0 | 1 | | ||
| ax{01,3} | last | 1 | 2 | | ||
| ax{01,3} | last | 1 | 8 | | ||
| ax{01,3} | last | 7 | 8 | |
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 (and others like it) looks like an existing bug. I think it is due to this line in simpleCharacter
not considering qualifiers longer than one character (such as the multiples notation {n, m}
).
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.
A few comments. Otherwise this looks good to me. 👍
Co-authored-by: yoff <lerchedahl@gmail.com>
4fd8b1a
to
ca0e26f
Compare
ca0e26f
to
0c23f58
Compare
I see from the failed tests that something is off with using simple chars instead of normal chars. I would like to understand what that is, but it does not have to be during this PR. |
I think |
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.
LGTM, is the DCA run from earlier still valid?
|
Yes, the |
The Javascript library groups sequences of normal characters, it would be good to make the behaviour of the regex libraries behave as similarly to each other as possible.