#NEWLINE# def evaluateFunctionReference( node , sphinxContext ) : #NEWLINE# #INDENT# name = node . name #NEWLINE# if ( name in ( 'error' , 'warning' , 'info' , 'pass' ) ) : #NEWLINE# #INDENT# sphinxContext . dynamicSeverity = node . name #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( name == 'unbound' ) : #NEWLINE# #INDENT# return UNBOUND #NEWLINE# #UNINDENT# #UNINDENT# if ( name in aggreateFunctionImplementation ) : #NEWLINE# #INDENT# return evaluateAggregateFunction ( node , sphinxContext , name ) #NEWLINE# #UNINDENT# if ( name in sphinxContext . functions ) : #NEWLINE# #INDENT# resolveValues = ( sphinxContext . functions [ name ] . functionType == 'function' ) #NEWLINE# namedParametersAssignedTo = sphinxContext . localVariables #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# resolveValues = True #NEWLINE# if ( name in ( 'error' , 'warning' , 'info' , 'pass' ) ) : #NEWLINE# #INDENT# namedParametersAssignedTo = sphinxContext . tags #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# namedParametersAssignedTo = sphinxContext . localVariables #NEWLINE# #UNINDENT# #UNINDENT# for localVar in node . localVariables : #NEWLINE# #INDENT# evaluate ( localVar , sphinxContext ) #NEWLINE# #UNINDENT# args = [ ] #NEWLINE# tagName = None #NEWLINE# l = len ( node . args ) #NEWLINE# for i in range ( l ) : #NEWLINE# #INDENT# arg = node . args [ i ] #NEWLINE# if ( arg == '=' ) : #NEWLINE# #INDENT# if ( i > 0 ) : #NEWLINE# #INDENT# tagName = node . args [ ( i - 1 ) ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( i == ( l - 1 ) ) or ( node . args [ ( i + 1 ) ] != '=' ) ) : #NEWLINE# #INDENT# if resolveValues : #NEWLINE# #INDENT# arg = evaluate ( arg , sphinxContext , value = True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( isinstance ( arg , astVariableReference ) and getattr ( sphinxContext . localVariables . get ( arg . variableName ) , 'isMacroParameter' , False ) ) : #NEWLINE# #INDENT# arg = sphinxContext . localVariables [ arg . variableName ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( arg , astNode ) : #NEWLINE# #INDENT# arg . isMacroParameter = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# args . append ( arg ) #NEWLINE# if tagName : #NEWLINE# #INDENT# namedParametersAssignedTo [ resolveValues ] = arg #NEWLINE# #UNINDENT# tagName = None #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( name in ( 'error' , 'warning' , 'info' , 'pass' ) ) : #NEWLINE# #INDENT# result = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( name in sphinxContext . functions ) : #NEWLINE# #INDENT# result = evaluateFunctionDeclaration ( sphinxContext . functions [ name ] , sphinxContext , args ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( name in functionImplementation ) : #NEWLINE# #INDENT# result = functionImplementation [ name ] ( node , sphinxContext , args ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise SphinxException ( node , 'sphinx:functionName' , _ ( 'unassigned function name %(name)s' ) , name = name ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for localVar in node . localVariables : #NEWLINE# #INDENT# del sphinxContext . localVariables [ localVar . name ] #NEWLINE# #UNINDENT# return result