#NEWLINE# def parse_default( tokens , name , context ) : #NEWLINE# #INDENT# ( first , pos ) = tokens [ 0 ] #NEWLINE# assert first . startswith ( 'default ' ) #NEWLINE# first = first . split ( None , 1 ) [ 1 ] #NEWLINE# parts = first . split ( '=' , 1 ) #NEWLINE# if ( len ( parts ) == 1 ) : #NEWLINE# #INDENT# raise TemplateError ( ( 'Expression must be {{default var=value}}; no = found in %r' % first ) , position = pos , name = name ) #NEWLINE# #UNINDENT# var = parts [ 0 ] . strip ( ) #NEWLINE# if ( ',' in var ) : #NEWLINE# #INDENT# raise TemplateError ( '{{default x, y = ...}} is not supported' , position = pos , name = name ) #NEWLINE# #UNINDENT# if ( not var_re . search ( var ) ) : #NEWLINE# #INDENT# raise TemplateError ( ( 'Not a valid variable name for {{default}}: %r' % var ) , position = pos , name = name ) #NEWLINE# #UNINDENT# expr = parts [ 1 ] . strip ( ) #NEWLINE# return ( ( 'default' , pos , var , expr ) , tokens [ 1 : ] )