nl_tokens: Get the node that is annotated by the comment or throw if not present .
pl_tokens: function getAnnotatedNode ( comment ) { // find the first function declaration or expression following the annotation var result ; if ( <mask> . annotates ) { var candidateTrees ; // consider the context the block is in (i.e. what is its parent) var parent = comment . annotates . parent ; // consider nodes from the annotated node forward //  include the first non-generated node and all generated nodes preceding it if ( testNode . isBlockOrProgram ( parent ) ) { var body = parent . body ; var index = body . indexOf ( comment . annotates ) ; var candidates = body . slice ( index ) ; var length = candidates . map ( testNode . isGeneratedCode ) . indexOf ( false ) + 1 ; candidateTrees = candidates . slice ( 0 , length || candidates . length ) ; } // otherwise we can only consider the given node else { candidateTrees = [ comment . annotates ] ; } // try the nodes while ( ! result && candidateTrees . length ) { result = esprimaTools . orderNodes ( candidateTrees . shift ( ) ) . filter ( testNode . isFunctionNotIFFE ) . shift ( ) ; } } // throw where not valid if ( result ) { return result ; } else { errorFn ( 'Doc-tag @ngInject does not annotate anything' ) ; } }