[GSOC] regular expressions beta is here

Dmitry Olshansky dmitry.olsh at gmail.com
Wed Aug 10 04:51:32 PDT 2011


On 10.08.2011 15:34, Jacob Carlborg wrote:
> On 2011-08-10 12:42, Dmitry Olshansky wrote:
>> In case I failed to mention it before, I m working on the project
>> codenamed FReD that is aimed at ~100%* source level compatible overhaul
>> of std.regex, that uses better implementation techniques, provides
>> modern Unicode support and common syntax riches.
>>
>> I think it's time for a public beta release, since it _should_ be ready
>> for mainstream usage. There are some rough edges, and a couple issues
>> that I'm aware of but they are nowhere in realistic use cases.
>>
>> In order to avoid unexpected regressions I'd be glad if current
>> std.regex users do try it for their projects/tests.
>> To get a small no-crap-included beta package see download section of
>> https://github.com/blackwhale/FReD for .7zs.
>> I'll upload newer packages as bugs get exposed and fixed. Alternatively,
>> if you a comfortable with git you may just git clone entire repo. Some
>> helpful notes (same as README) can be found here :
>> https://github.com/blackwhale/FReD/wiki/Beta-release
>>
>> Caveats:
>> In order for it compile a tiny change to 2.054 source is needed (no need
>> to recompile Phobos! it's only in templates):
>> patch std.algorithm.cmp according to this diff
>> https://github.com/D-Programming-Language/phobos/pull/176/files#L0L4631
>> <https://github.com/D-Programming-Language/phobos/pull/176/files#L0L4633> 
>>
>> and to get CTFE features working add if(!__ctfe) listed in the next diff
>> on the same webpage.
>> (this is already upstream, so if you're using a fork of phobos just pull
>> this in)
>>
>> * some API problems might lead to a breaking change, though it didn't
>> happen in this release
>
> I have a suggestion, make RegexMatch implicitly convertible to bool, 
> indicating if there was a match or not.
>
Interesting idea, one problem with it is that I want this:

auto m = match("bleh", "bleh");
writeln(m);

to actually print "bleh", not true
Right now due to a carry over bug from std.regex (interface thing) 
writln(m) will just do a stackoverflow, m.hit however works.

> Aren't there a lot of things that should be declared as private in the 
> fred.d module?
>

Yes, it's a side effect of me having a lot of debugging tool that do 
need these internals. If only package protection attribute of something 
was working....
Not to mention that the whole module should work in SafeD with a couple 
of @trusted here and there.

-- 
Dmitry Olshansky



More information about the Digitalmars-d mailing list