Am 12.03.2013 03:25, schrieb Daniel Murphy:
"Iain Buclaw" <ibuc...@ubuntu.com> wrote in message
news:mailman.357.1363023395.14496.digitalmar...@puremagic.com...
(The D conversion seems to think it's lisp).
Expression resolveLoc(Loc loc, Scope sc)
{
tracein("resolveLoc");
scope(success) traceout("resolveLoc");
scope(failure) traceerr("resolveLoc");
{
FuncDeclaration fd;
if (sc.callsc && sc.callsc.func)
fd = sc.callsc.func;
else fd = sc.func;
const(char)* s;
if (fd)
{
const(char)* funcStr = fd.Dsymbol.toPrettyChars();
HdrGenState hgs;
OutBuffer buf = new OutBuffer();
functionToCBuffer2(cast(TypeFunction)fd.type, buf, &hgs, 0,
funcStr);
buf.writebyte(0);
s = cast(const(char)*)buf.extractData();
}
else {
s = "";
}
Expression e = new StringExp(loc, cast(char*)s);
e = e.semantic(sc);
e = e.castTo(sc, type);
return e;
}
}
looks not that bad - the big question for me is - do you think that this
could be the way to do the port (or do you just "test" how far you can
get with automated conversion)