#NEWLINE# def _validate_template_inst( node , lexer ) : #NEWLINE# #INDENT# ' Validate a template instantiation.\n\n    This function ensures that the bindings on the instantiation refer\n    to declared identifiers on the instantiation.\n\n    ' #NEWLINE# names = set ( ) #NEWLINE# if node . identifiers : #NEWLINE# #INDENT# names . update ( names . identifiers . names ) #NEWLINE# #UNINDENT# for binding in node . body : #NEWLINE# #INDENT# if ( binding . name not in names ) : #NEWLINE# #INDENT# msg = "'%s' is not a valid template id reference" #NEWLINE# syntax_error ( ( msg % binding . name ) , FakeToken ( lexer , binding . lineno ) )