UDA + Pegged AST Hack

Philippe Sigaud philippe.sigaud at gmail.com
Thu Nov 29 11:50:00 PST 2012


>
> I'm trying to find a safe spot in the middle of a file, where I can start
> parsing, normally you have to parse the entire file to understand it, ex
> with your grammar files, there are many keywords inside huge strings, so
> basically I let the compiler handle comments and white-space parsing, which
> allows to me to make a stable localized parser for a subset of the language.


OK, this I get.


>
>
>  What I don't get is how the [__LINE__] part in magic contains significant
>> info.
>>
>
> It allows me to retrieve the entire original source for a declaration...
> it kinda emulates a ".sourceof" trait / property. :)
>

Yeah but... What does this have to do with __LINE__? I'm sorry if I'm dumb
here, I still haven't used UDAs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121129/99113f73/attachment-0001.html>


More information about the Digitalmars-d mailing list