-
Notifications
You must be signed in to change notification settings - Fork 25
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
tr: add full support for ranges #314
tr: add full support for ranges #314
Conversation
tr currently only handles ranges if they are the only construct in the string containing them (see `contains_single_range`). Add proper handling of ranges: multiple in one string, ranges from one character type to another (e.g. tr -d '\060-9 A-Z'). Fix handling of octal sequences above \377. Add validation to ensure equiv (in "[=equiv=]" constructs) is only one character. Add validation to ensure ranges are not "backwards" (the ending character be must greater than or equal to the starting character). Parse and validate string1 and string2 before reading from stdin.
3b6964e
to
0d821e0
Compare
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
Needs minor merge conflict resolution but overall looks like forward progress |
0d821e0
to
d2c6c48
Compare
|
I meant for those points to be rendered as +'s and -s':
There are still many improvements that could be made here. I should have some more PRs for those soonish. I will keep an eye out for reports of bugs/regressions. |
tr currently only handles ranges if they are the only construct in
the string containing them (see
contains_single_range
).Add proper handling of ranges: multiple in one string, ranges from
one character type to another (e.g. tr -d '\060-9 A-Z').
Fix handling of octal sequences above \377.
Add validation to ensure equiv (in "[=equiv=]" constructs) is only
one character.
Add validation to ensure ranges are not "backwards" (the ending
character be must greater than or equal to the starting character).
Parse and validate string1 and string2 before reading from stdin.