Thank a lot ! That solved it !<br><br><div class="gmail_quote">Le 26 mars 2012 05:31, kenji hara <span dir="ltr"><<a href="mailto:k.hara.pg@gmail.com">k.hara.pg@gmail.com</a>></span> a écrit :<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2012年3月26日10:31 deadal nix <<a href="mailto:deadalnix@gmail.com">deadalnix@gmail.com</a>>:<br>
<div class="im">> Hi,<br>
><br>
> I wanted to try out to do some hacking into DMD. I ran in a problem that I<br>
> have no clue how to solve.<br>
><br>
> I did the following to generate some function with an alternative syntax :<br>
> Type* type = new TypeIdentifier(loc, typeId);<br>
> Parameters* ps = new Parameters();<br>
> ps->push(new Parameter(0, type, new Identifier("argument",<br>
> TOKidentifier), NULL));<br>
<br>
</div> ps->push(new Parameter(0, type, Lexer::idPool("argument"), NULL));<br>
<div class="im"><br>
> Statement* body = parseStatement(PScurly);<br>
> f = new FuncDeclaration(loc, this->loc, id, STCundefined, new<br>
> TypeFunction(ps, type, 0, LINKd, STCundefined));<br>
> f->fbody = body;<br>
><br>
> Dsymbols *decldefs = new Dsymbols();<br>
> decldefs->push(f);<br>
><br>
> return new TemplateDeclaration(loc, id, tpl, constraint, decldefs, 0);<br>
><br>
> It works great, except that I can't use argument in the function body. I got<br>
> an identifier missing message. What is missing to enable this identifier to<br>
> be resolved as a regular function parameter ?<br>
<br>
</div>In basic, each identifier object is unique, and in semantic they are<br>
compared only their address.<br>
<span class="HOEnZb"><font color="#888888"><br>
Kenji Hara<br>
_______________________________________________<br>
dmd-internals mailing list<br>
<a href="mailto:dmd-internals@puremagic.com">dmd-internals@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/dmd-internals" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-internals</a><br>
</font></span></blockquote></div><br>