#NEWLINE# def _tgrep_macro_use_action( _s , _l , tokens ) : #NEWLINE# #INDENT# '\n    Builds a lambda function which looks up the macro name used.\n    ' #NEWLINE# assert ( len ( tokens ) == 1 ) #NEWLINE# assert ( _s [ 0 ] [ 0 ] == '@' ) #NEWLINE# macro_name = tokens [ 0 ] [ 1 : ] #NEWLINE# def macro_use( n , m = None , l = None ) : #NEWLINE# #INDENT# if ( ( m is None ) or ( macro_name not in m ) ) : #NEWLINE# #INDENT# raise TgrepException ( 'macro {0} not defined' . format ( macro_name ) ) #NEWLINE# #UNINDENT# return m [ macro_name ] ( n , m , l ) #NEWLINE# #UNINDENT# return macro_use