Offering Access to Parser

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 10 04:24:49 PST 2016


On 2016-02-09 23:14, cy wrote:

> So the above would end up more like:
>
> import std.parser;
> AST foo(string bar) = IfDeclaration(parse(bar),
> parse(q{writeln("yay")}), parse(q{writeln("boo")}));
>
>
> void main() {
>    mixin foo!"true";
>    mixin foo!"false";
> }

That's very close to AST macros. The only difference is the need to 
parse the input, "bar" in this case.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list