Re: Regex in ctfe?

2016-01-31 Thread tsbockman via Digitalmars-d
On Wednesday, 27 January 2016 at 21:09:19 UTC, Era Scarecrow wrote: On Wednesday, 27 January 2016 at 20:25:33 UTC, H. S. Teoh wrote: Currently, AFAIK, (d)dmd does not use anything from Phobos. I'm not sure if this is a temporary situation, or there's a strong reason for it. Probably since it

Re: Regex in ctfe?

2016-01-31 Thread Philippe Sigaud via Digitalmars-d
On Tuesday, 26 January 2016 at 01:34:09 UTC, Manu wrote: Possible to std.regex in ctfe? (...) I have a string import destined for a mixin, and I want to parse it with regex, but I haven't been able to make it work. The docs mention nothing about this possibility. Hi Manu, a possible solutio

Re: Regex in ctfe?

2016-01-27 Thread Era Scarecrow via Digitalmars-d
On Wednesday, 27 January 2016 at 20:25:33 UTC, H. S. Teoh wrote: On Wed, Jan 27, 2016 at 07:54:21PM +, Era Scarecrow via Digitalmars-d wrote: But it would seem easier/simpler if the compiler just hooks in the Regex that's compiled into it instead and passes the data back and forth. It d

Re: Regex in ctfe?

2016-01-27 Thread H. S. Teoh via Digitalmars-d
On Wed, Jan 27, 2016 at 07:54:21PM +, Era Scarecrow via Digitalmars-d wrote: > On Wednesday, 27 January 2016 at 19:05:01 UTC, H. S. Teoh wrote: > >An alternative would be to use `if (_ctfe)` branches in the code to > >switch to a different matching engine when in CTFE, and leaving the > >runtim

Re: Regex in ctfe?

2016-01-27 Thread Era Scarecrow via Digitalmars-d
On Wednesday, 27 January 2016 at 19:05:01 UTC, H. S. Teoh wrote: An alternative would be to use `if (_ctfe)` branches in the code to switch to a different matching engine when in CTFE, and leaving the runtime code untouched. Hmmm... As I recall there's 2 major engines that run Regex (DFA & N

Re: Regex in ctfe?

2016-01-27 Thread H. S. Teoh via Digitalmars-d
On Wed, Jan 27, 2016 at 06:47:59PM +, Pierre Krafft via Digitalmars-d wrote: > On Tuesday, 26 January 2016 at 12:47:26 UTC, w0rp wrote: > >Unless I'm mistaken, I think the compiler for regex currently works > >at compile time, but not the matcher. Maybe someone who knows the > >module could add

Re: Regex in ctfe?

2016-01-27 Thread Pierre Krafft via Digitalmars-d
On Tuesday, 26 January 2016 at 12:47:26 UTC, w0rp wrote: Unless I'm mistaken, I think the compiler for regex currently works at compile time, but not the matcher. Maybe someone who knows the module could add support for that. That's correct. I looked in to this a while ago and found out that

Re: Regex in ctfe?

2016-01-26 Thread w0rp via Digitalmars-d
Unless I'm mistaken, I think the compiler for regex currently works at compile time, but not the matcher. Maybe someone who knows the module could add support for that.

Re: Regex in ctfe?

2016-01-26 Thread Stefan Koch via Digitalmars-d
On Tuesday, 26 January 2016 at 11:35:24 UTC, Era Scarecrow wrote: On Tuesday, 26 January 2016 at 05:10:58 UTC, Manu wrote: I thought DMD was fully converted to D? The compiler could make use of std.regex if it wanted to... My experience is at least a year or two out of date; One of the DConf

Re: Regex in ctfe?

2016-01-26 Thread Era Scarecrow via Digitalmars-d
On Tuesday, 26 January 2016 at 05:10:58 UTC, Manu wrote: I thought DMD was fully converted to D? The compiler could make use of std.regex if it wanted to... My experience is at least a year or two out of date; One of the DConf2015 talks someone was working on a C++ to D converter, and planne

Re: Regex in ctfe?

2016-01-25 Thread Manu via Digitalmars-d
On 26 January 2016 at 12:58, Era Scarecrow via Digitalmars-d wrote: > What exactly are you trying to do i wonder? > > If it uses enough of a subset then maybe... I'll assume you tried and > failed already though. > > It seems more likely that a external library like PCRE would be compiled > int

Re: Regex in ctfe?

2016-01-25 Thread Era Scarecrow via Digitalmars-d
What exactly are you trying to do i wonder? If it uses enough of a subset then maybe... I'll assume you tried and failed already though. It seems more likely that a external library like PCRE would be compiled into the compiler instead and you could hook into it; But with probable mismatc

Regex in ctfe?

2016-01-25 Thread Manu via Digitalmars-d
Possible to std.regex in ctfe? I kinda had it in my mind that ctRegex was ctfe-able, but it seems it's not. It just generates an efficient regex engine at compile time which only actually works on data at runtime. I have a string import destined for a mixin, and I want to parse it with regex, but