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

rollup recent PRs + miscellaneous fixes #567

Merged
merged 8 commits into from
Mar 30, 2019
Merged

rollup recent PRs + miscellaneous fixes #567

merged 8 commits into from
Mar 30, 2019

Conversation

BurntSushi
Copy link
Member

This rolls up a few PRs and fixes a couple small parser related bugs. See the commit messages for details.

BurntSushi and others added 8 commits March 30, 2019 08:33
When performing "EndText" matching, it is necessary to check whether
the current position matches the input text length. However, when
capturing a submatch using the matching result of DFA, "EndText"
matching wasn't actually performed correctly because the input text is
sliced.

By applying this patch we specify the match end position by the
argument "end", not using slice when performing capture with the
matching result of DFA.

Fixes #557, Closes #561
This updates the README examples to drop the use of `extern crate`. We
do include instructions to add it, but only for Rust 2015.

Closes #552
This commit exposes two new functions in regex's C API: rure_escape_must
and rure_cstring_free. These permit escaping a pattern such that it
contains no special regex meta characters.

Currently, we only expose a routine that will abort the process if it
fails, but we document the precise error conditions. A more flexible but
less convenient routine should ideally be exposed in the future, but
that needs a bit more API design than what's here.

Closes #537
This fixes a bug where the HIR translator would panic on regexes such as
`(?i){1}` since it assumes that every repetition operator has a valid
sub-expression, and `(?i)` is not actually a sub-expression (but is more
like a directive instead).

Previously, we fixed this same bug for *uncounted* repetitions in commit
17764ff (for bug #465), but we did not fix it for counted repetitions.
We apply the same fix here.

Fixes #555
This fixes yet another bug with our handling of (?flags) directives in
the regex. This time, we try to be a bit more principled and
specifically treat a (?flags) directive as a valid empty sub-expression.
While this means we could remove errors reported from previous fixes for
things like `(?i)+`, we retain those for now since they are a bit weird.
Although `((?i))+` is now allowed, which is equivalent. We should
probably allow `(?i)+` in the future for consistency sake.

Fixes #527
It's impossible to do this without the cooperation of maintainers from
other core crates, and some of them do not see the value in doing this.
@BurntSushi BurntSushi merged commit 8f9ca96 into master Mar 30, 2019
@BurntSushi BurntSushi deleted the ag/rollup branch March 30, 2019 14:47
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.

None yet

2 participants