Bug 10798 – std.regex: ctRegex unicode set ops unimplemented

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-11T13:17:00Z
Last change time
2014-04-23T18:31:45Z
Assigned to
nobody
Creator
dmitry.olsh

Comments

Comment #0 by dmitry.olsh — 2013-08-11T13:17:28Z
Another limitation of ctRegex vs regex that should be lifted. Full Unicode set algebra is implemented using structural casts of POD structs that don't work in CTFE. import std.algorithm, std.regex; void main() { auto cr = regex("[abcd--c]*"); auto m = "abc".match(cr); assert(m); assert(m.hit == "ab"); } Produces this messy equivalent of "sorry not there yet": std\internal\uni.d(175): Error: array cast from uint[] to Interval[] is not supported at compile time std\regex.d(1707): called from here: stack.top().sub(s) std\regex.d(1730): called from here: apply(opstack.pop(), vstack) std\regex.d(1755): called from here: unrollWhile(vstack, opstack) std\regex.d(1755): called from here: enforce(unrollWhile(vstack, opstack), delegate const(char)[]( { return "CodepointSet syntax error"; } , "std\\regex.d", 1755u) std\regex.d(1348): called from here: this.parseCharset() std\regex.d(1172): called from here: this.parseAtom() std\regex.d(910): called from here: this.parseRegex() std\regex.d(6473): called from here: parser.this(pattern, flags) std\regex.d(6466): called from here: regexImpl(pattern, flags) std\regex.d(6481): called from here: regex("[abc--b]*", []) std\regex.d(6507): Error: template instance std.regex.ctRegexImpl!("[abc--b]*", []) error instantiating test_reg.d(26): instantiated from here: ctRegex!"[abc--b]*" test_reg.d(26): Error: template instance std.regex.ctRegex!"[abc--b]*" error instantiating
Comment #1 by github-bugzilla — 2014-04-23T18:31:44Z