#NEWLINE# def chart( name , parser , token ) : #NEWLINE# #INDENT# args = token . split_contents ( ) #NEWLINE# if ( len ( args ) < 2 ) : #NEWLINE# #INDENT# raise template . TemplateSyntaxError ( ( '%r statement requires at least one argument' % token . split_contents ( ) [ 0 ] ) ) #NEWLINE# #UNINDENT# options = None #NEWLINE# if ( len ( args ) > 2 ) : #NEWLINE# #INDENT# if ( args [ 2 ] != 'with' ) : #NEWLINE# #INDENT# raise template . TemplateSyntaxError ( "Expected 'with' statement" ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# options = parse_options ( ' ' . join ( args [ 3 : ] ) ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise template . TemplateSyntaxError ( 'Invalid options' ) #NEWLINE# #UNINDENT# #UNINDENT# return ChartNode ( name = name , variable = args [ 1 ] , options = options )