[nem-en] macro to define a new kind of member

Kamil Dworakowski kamil.dworakowski at googlemail.com
Fri Feb 23 16:36:23 CET 2007


I am working on the AOP macros and want it to have a nice syntax. For 
that purpose I would like to have a possibility to define syntax of a 
new member (this will allow for a better implementation of NemerleUnit 
also) by means of a macro. Needed to define advice and pointcut.

I have been able to modify MainParser.ParseClassMember so as it would 
try to parse top extension targeted at a class and add it to the 
modifiers of the enclosing type. I hope I have not broken anything due 
to ignorance. Don't worry it is careful about nested types, though.

I have committed it to the repository but am not fully satisfied. I 
would also like to pass modifiers as well as custom attributes as 
parameters to that macro. I was thinking of adding a new macro target, 
namely, WithingClass. Such target would (enforce/generate if not 
present) two additional parameters for attrs. Someone has another idea?

Kamil Dworakowski

PS. Compilers's code is cleverly structured, I've enjoyed working on it.



More information about the devel-en mailing list