Skip to content

Instantly share code, notes, and snippets.

@bioinfornatics
Created March 12, 2012 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bioinfornatics/2024722 to your computer and use it in GitHub Desktop.
Save bioinfornatics/2024722 to your computer and use it in GitHub Desktop.
$ diff runtime/phobos/std/regex.d ../phobos/std/regex.d
184c184
< $(WEB http://unicode.org/reports/tr18/, UTS 18). Specifically:
---
> $(WEB unicode.org/reports/tr18/, UTS 18). Specifically:
5560a5561,5564
> static if(direction == OneShot.Fwd)
> startPc = startPc;
> else
> startPc = cast(uint)re.ir.length-IRL!(IR.LookbehindEnd);
5564,5568c5568
< auto startT = createStart(index);
< static if(direction == OneShot.Fwd)
< startT.pc = startPc;
< else
< startT.pc = cast(uint)re.ir.length-IRL!(IR.LookbehindEnd);
---
> auto startT = createStart(index, startPc);
5613a5614,5616
> if(!matched)
> evalFn!false(createStart(index, startPc), matches);
>
6100c6103
< Thread!DataIndex* createStart(DataIndex index)
---
> Thread!DataIndex* createStart(DataIndex index, uint pc=0)
6105c6108
< t.pc = 0;
---
> t.pc = pc;
6142c6145
< @trusted public struct Captures(R,DIndex)
---
> @trusted public struct Captures(R, DIndex=size_t)
6766c6769
< ///A helper function, creates a $(D Spliiter) on range $(D r) separated by regex $(D pat).
---
> ///A helper function, creates a $(D Splitter) on range $(D r) separated by regex $(D pat).
7424,7430d7426
< //@@@BUG@@@ template function doesn't work inside unittest block
< version(unittest)
< Cap.String baz(Cap)(Cap m)
< if (is(Cap==Captures!(Cap.String,Cap.DataIndex)))
< {
< return std.string.toUpper(m.hit);
< }
7438a7435,7439
> auto baz(Cap)(Cap m)
> if (is(Cap==Captures!(Cap.String)))
> {
> return std.string.toUpper(m.hit);
> }
7448c7449
< auto s = std.regex.replace!(baz!(Captures!(String,size_t)))(to!String("Strap a rocket engine on a chicken."),
---
> auto s = std.regex.replace!(baz!(Captures!(String)))(to!String("Strap a rocket engine on a chicken."),
7488a7490
>
7495a7498,7501
> }
> unittest
> {//bugzilla 7111
> assert(!match("", regex("^")).empty);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment