Is this a std.regex bug?
Andrea Fontana
nospam at example.com
Wed Aug 8 00:28:57 PDT 2012
import std.regex;
void main() {
auto r = ctRegex!(r"/a/b/(c|d|e|f)", "g");
}
This simple app fails at compile time.
Online compiler says:
/usr/local/include/dmd2/std/regex.d(1150): Error:
assert(this.ir[cast(ulong)orStart].code() == cast(IR)129u) failed
/usr/local/include/dmd2/std/regex.d(876): called from here:
this.parseRegex()
/usr/local/include/dmd2/std/regex.d(6428): called from here:
parser.this(pattern,flags)
/usr/local/include/dmd2/std/regex.d(6412): called from here:
regexImpl(pattern,flags)
/usr/local/include/dmd2/std/regex.d(6437): called from here:
regex("/a/b/(c|d|e|f)","g")
/usr/local/include/dmd2/std/regex.d(1150): Error:
assert(this.ir[cast(ulong)orStart].code() == cast(IR)129u) failed
/usr/local/include/dmd2/std/regex.d(876): called from here:
this.parseRegex()
/usr/local/include/dmd2/std/regex.d(6428): called from here:
parser.this(pattern,flags)
/usr/local/include/dmd2/std/regex.d(6412): called from here:
regexImpl(pattern,flags)
/usr/local/include/dmd2/std/regex.d(6439): called from here:
regex("/a/b/(c|d|e|f)","g")
/usr/local/include/dmd2/std/regex.d(6439): called from here:
ctGenRegExCode(regex("/a/b/(c|d|e|f)","g"))
/usr/local/include/dmd2/std/regex.d(1150): Error:
assert(this.ir[cast(ulong)orStart].code() == cast(IR)129u) failed
/usr/local/include/dmd2/std/regex.d(876): called from here:
this.parseRegex()
/usr/local/include/dmd2/std/regex.d(6428): called from here:
parser.this(pattern,flags)
/usr/local/include/dmd2/std/regex.d(6412): called from here:
regexImpl(pattern,flags)
/usr/local/include/dmd2/std/regex.d(6446): called from here:
regex("/a/b/(c|d|e|f)","g")
/usr/local/include/dmd2/std/regex.d(6446): called from here:
StaticRegex(null,Regex(null,null,null,0u,0u,0u,0u,0u,null,null,ShiftOr(null,0u,0u))).this(regex("/a/b/(c|d|e|f)","g"),& func)
/usr/local/include/dmd2/std/regex.d(6463): Error: template instance
std.regex.ctRegexImpl!("/a/b/(c|d|e|f)","g") error instantiating
822.d(5): instantiated from here: ctRegex!("/a/b/(c|d|e|f)","g")
822.d(5): Error: template instance std.regex.ctRegex!("/a/b/(c|d|e|
f)","g") error instantiating
Il giorno mar, 07/08/2012 alle 19.53 +0400, Dmitry Olshansky ha scritto:
> On 07-Aug-12 16:06, Andrea Fontana wrote:
> > dmd 2.060 64bit ubuntu:
> >
> > // Doesn't work:
> > auto r = ctRegex!(r"/api/places/(id|related|search|count)\.(json|xml)",
> > "g");
> >
>
> Could be. It is experimental and is known to have bugs.
> What is the exact problem statement?
>
> > // Works:
> > auto r = regex(r"/api/places/(id|related|search|count)\.(json|xml)", "g");
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120808/c2760bd4/attachment-0001.html>
More information about the Digitalmars-d-learn
mailing list