#NEWLINE# def transform( self , args , kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# for arg in args : #NEWLINE# #INDENT# assert isinstance ( arg , Expr ) , ( 'Macros can only take syntax nodes as arguments, got %s' % ( arg , ) ) #NEWLINE# #UNINDENT# for ( name , arg ) in kwargs . iteritems ( ) : #NEWLINE# #INDENT# assert isinstance ( arg , Expr ) , ( 'Macros can only take syntax nodes as arguments, got %s = %s' % ( name , arg ) ) #NEWLINE# #UNINDENT# result = self . f ( * args , ** kwargs ) #NEWLINE# assert isinstance ( result , Expr ) , ( 'Expected macro %s to return syntax expression, got %s' % ( self . f , result ) ) #NEWLINE# return result