using regex at compiletime

gedaiu via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 15 01:38:39 PDT 2014


Hi,

I am trying to use regex at compile time for pasing of some html 
files. The code works perfect at runtime but at compile time i 
get this error:



/usr/include/dmd/phobos/std/regex.d(5824): Error: malloc cannot 
be interpreted at compile time, because it has no available 
source code
/usr/include/dmd/phobos/std/regex.d(5824):        called from 
here: enforce(malloc(size), delegate const(char)[]() => null, 
"/usr/include/dmd/phobos/std/regex.d", 5824LU)
/usr/include/dmd/phobos/std/regex.d(5961):        called from 
here: matchOnce(input, re)
source/cthtml.d(121):        called from here: matchFirst(text, 
rTag)
source/cthtml.d(397):        called from here: 
structure.this(content, "", "ROOT")


It is not possible to use regex at compiletime and I should use 
palain text matching?

Thanks,
Bogdan


More information about the Digitalmars-d-learn mailing list