Re: Compile time regex matching

2014-07-15 Thread Philippe Sigaud via Digitalmars-d-learn
> I did, and I got it to work. Unfortunately, the code used to in the CTFE is > left in the final executable even though it is not used at runtime. So now > the question is, is there away to get rid of the excess baggage? Not that I know of. Once code is injected, it's compiled into the executable

Re: Compile time regex matching

2014-07-15 Thread Jason den Dulk via Digitalmars-d-learn
On Monday, 14 July 2014 at 11:43:01 UTC, Philippe Sigaud via Digitalmars-d-learn wrote: You can try Pegged, a parser generator that works at compile-time (both the generator and the generated parser). I did, and I got it to work. Unfortunately, the code used to in the CTFE is left in the fi

Re: Compile time regex matching

2014-07-14 Thread Philippe Sigaud via Digitalmars-d-learn
On Mon, Jul 14, 2014 at 3:19 PM, Artur Skawina via Digitalmars-d-learn wrote: > On 07/14/14 13:42, Philippe Sigaud via Digitalmars-d-learn wrote: >> asserts get an entire copy of the parse tree. It's a bit wasteful, but >> using 'immutable' directly does not work here, but this is OK: >> >> en

Re: Compile time regex matching

2014-07-14 Thread Artur Skawina via Digitalmars-d-learn
On 07/14/14 13:42, Philippe Sigaud via Digitalmars-d-learn wrote: > asserts get an entire copy of the parse tree. It's a bit wasteful, but > using 'immutable' directly does not work here, but this is OK: > > enum res = MyRegex("abcabcdefFOOBAR"); // compile-time parsing > immutable result

Re: Compile time regex matching

2014-07-14 Thread Philippe Sigaud via Digitalmars-d-learn
> I am trying to write some code that uses and matches to regular expressions > at compile time, but the compiler won't let me because matchFirst and > matchAll make use of malloc(). > > Is there an alternative that I can use that can be run at compile time? You can try Pegged, a parser generator

Compile time regex matching

2014-07-13 Thread Jason den Dulk via Digitalmars-d-learn
Hi I am trying to write some code that uses and matches to regular expressions at compile time, but the compiler won't let me because matchFirst and matchAll make use of malloc(). Is there an alternative that I can use that can be run at compile time? Thanks in advance. Jason

Re: compile time regex

2012-06-16 Thread Philippe Sigaud
On Sat, Jun 16, 2012 at 10:50 PM, Dmitry Olshansky wrote: > 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 reg

Re: compile time regex

2012-06-16 Thread Dmitry Olshansky
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

compile time regex

2012-06-16 Thread Ellery Newcomer
There is a ctRegex; is there a compile time equivalent for match?