Uh oh!
There was an error while loading. Please reload this page.
add regexp crate to Rust distribution (implements RFC 7) - #13700
Conversation
UtherII
commented
Apr 23, 2014
Maybe a silly question, but wouldn't it make sense to put Unicode character classes support into the standard rust string library? |
BurntSushi
commented
Apr 23, 2014
Possibly. But I'm not sure. What would they be used for in Note that the matching algorithm depends on those Unicode classes to be available in sorted non-overlapping order, so that they are amenable to binary search. One possible path forward is to leave them in |
There was a problem hiding this comment.
We've generally tried to not use html tags in our documentation, this is done to not run the test/lexer over the contents? You may be able to get away with a notrust tag after three backticks.
There was a problem hiding this comment.
Actually, the reasoning is more insidious: I was unable to write a plain \ character in a fenced code block, so I resorted to the simpler solution of just writing the HTML. (I wasn't able to determine if this was a bug in the sundown parser or elsewhere...)
alexcrichton
commented
Apr 23, 2014
This looks even better than I thought it was going to be, amazing work, and thank you so much! |
alexcrichton
commented
Apr 23, 2014
Ah, one more small thing, we're trying to ensure that commits can be traced back to the RFC they implemented, so could you make sure that this shows up at the bottom of the first commit message (you can wait to rebase until later) |
There was a problem hiding this comment.
Could you use h.find_equiv(name) here in order to avoid allocating an owned string?
BurntSushi
commented
Apr 23, 2014
@alexcrichton Thanks! And thanks very much for all your comments so far. Very helpful. I will make sure to add Also, when I rebase, won't it change my commit history? I assume I'll have to force push. (Just want to make sure that's what's expected.) |
thestinger
commented
Apr 23, 2014
@BurntSushi: Yeah, you'll have to force push. |
There was a problem hiding this comment.
The most recently landed PR actually makes this so ignore-cross-compile isn't necessary. The stack of commits will need to get rebase anyway, so just something to include in the rebasing.
alexcrichton
commented
Apr 23, 2014
Just a few small nits left, and otherwise this looks fantastic. After a rebasing, I think this is good to go! |
chris-morgan
commented
Apr 24, 2014
Argh, I didn't notice that when RFC 7 was accepted that it kept the name |
seanmonstar
commented
Apr 24, 2014
I just saw after a reload. Deleted my comment. |
huonw
commented
Apr 24, 2014
C++ uses regex too. |
BurntSushi
commented
Apr 24, 2014
I don't really like I would not be opposed to naming the macro
(The .NET crowd is notably missing, but they call their module I don't know what it means to choose one name over another based on Google Trends telling me that there is a There seems to be a slight overall preference toward |
chris-morgan
commented
Apr 24, 2014
@BurntSushi There still remains the question of |
BurntSushi
commented
Apr 24, 2014
I prefer |
seanmonstar
commented
Apr 24, 2014
Rust convention is CamelCase for types. |
BurntSushi
commented
Apr 24, 2014
@seanmonstar Depends on whether you consider |
BurntSushi
commented
Apr 24, 2014
If we have |
blaenk
commented
Apr 24, 2014
Count me for that one, I think |
liigo
commented
Apr 24, 2014
|
chris-morgan
commented
Apr 24, 2014
You meant the crate as |
BurntSushi
commented
Apr 24, 2014
@chris-morgan yes absolutely! Nice catch. Edited. |
BurntSushi
commented
Apr 24, 2014
OK, I've changed the name of the crate to |
There was a problem hiding this comment.
I'd just mark this as #[doc(hidden)]
Also adds a regex_macros crate, which provides natively compiled regular expressions with a syntax extension. Closesrust-lang#3591. RFC: 0007-regexps
Implements [RFC 7](https://github.com/rust-lang/rfcs/blob/master/active/0007-regexps.md) and will hopefully resolve#3591. The crate is marked as experimental. It includes a syntax extension for compiling regexps to native Rust code. Embeds and passes the `basic`, `nullsubexpr` and `repetition` tests from [Glenn Fowler's (slightly modified by Russ Cox for leftmost-first semantics) testregex test suite](http://www2.research.att.com/~astopen/testregex/testregex.html). I've also hand written a plethora of other tests that exercise Unicode support, the parser, public API, etc. Also includes a `regex-dna` benchmark for the shootout. I know the addition looks huge at first, but consider these things: 1. More than half the number of lines is dedicated to Unicode character classes. 2. Of the ~4,500 lines remaining, 1,225 of them are comments. 3. Another ~800 are tests. 4. That leaves 2500 lines for the meat. The parser is ~850 of them. The public API, compiler, dynamic VM and code generator (for `regexp!`) make up the rest.
alexcrichton
commented
Apr 25, 2014
Nice work @BurntSushi! |
1 similar comment
ghost
commented
Nov 21, 2015
Nice work @BurntSushi! |
This updates the documentation after rust-lang#13694. It is not based on that PR chain and can be merged independently, but should be merged after that PR. This is partly pulled from rust-lang#12762, but removing the Josh parts. This includes instructions on how to publish `clippy_utils`. Closesrust-lang/rust-clippy#13556 (yes, this is the final PR 🙂) r? @blyxyas changelog: `clippy_utils` is now published to crates.io
Implements RFC 7 and will hopefully resolve#3591. The crate is marked as experimental. It includes a syntax extension for compiling regexps to native Rust code.
Embeds and passes the
basic,nullsubexprandrepetitiontests from Glenn Fowler's (slightly modified by Russ Cox for leftmost-first semantics) testregex test suite. I've also hand written a plethora of other tests that exercise Unicode support, the parser, public API, etc. Also includes aregex-dnabenchmark for the shootout.I know the addition looks huge at first, but consider these things:
regexp!) make up the rest.