digitalmars.D.learn - compile time regex
- Ellery Newcomer (1/1) Jun 16 2012 There is a ctRegex; is there a compile time equivalent for match?
- Dmitry Olshansky (6/7) Jun 16 2012 No. Since last time I tried to hack through CTFE it failed horribly.
- Philippe Sigaud (13/19) Jun 16 2012 Ellery,
There is a ctRegex; is there a compile time equivalent for match?
Jun 16 2012
On 17.06.2012 0:44, Ellery Newcomer wrote:There is a ctRegex; is there a compile time equivalent for match?No. Since last time I tried to hack through CTFE it failed horribly. Bleh, I'd rather first make sure that most regexes actually _compile_ at CTFE. -- Dmitry Olshansky
Jun 16 2012
On Sat, Jun 16, 2012 at 10:50 PM, Dmitry Olshansky <dmitry.olsh gmail.com> wrote:On 17.06.2012 0:44, Ellery Newcomer wrote:Ellery, if you really need to match at CT, you can try Pegged: https://github.com/PhilippeSigaud/Pegged/wiki Be warned that while parsing at compile-time, it's not fast and will probably eat RAM like there is no tomorrow :) Youkei is developping CTPG, which is from the same family: https://github.com/youkei/ctpg/wiki/Home-en For both projects, the grammar is a PEG, not a regex, but the syntax is not that different. As PEG are more general, the engines are not optimized like std.regex. PhilippeThere is a ctRegex; is there a compile time equivalent for match?No. Since last time I tried to hack through CTFE it failed horribly. Bleh, I'd rather first make sure that most regexes actually _compile_ at CTFE.
Jun 16 2012