legal identifier check
grauzone
none at example.net
Sun May 31 13:19:18 PDT 2009
Saaa wrote:
>> Hello Saaa,
>>
>>>> static if(is(typeof({ /* code to be checked for validity goes here */
>>>> }))) ...
>>>>
>>> How does that piece of code work anyways :D
>>
>> that checks to see if the {...} is a valid delegate literal by using is()
>> to see if semantic checks fail.
>>
> Ah, I see. Can this be done at runtime?
You have to write it yourself. Here's a good starting point:
http://www.digitalmars.com/d/1.0/lex.html#identifier
More information about the Digitalmars-d-learn
mailing list