#NEWLINE# def lex_line( line ) : #NEWLINE# #INDENT# for ( token , rgx ) in line_regexes : #NEWLINE# #INDENT# match = rgx . match ( line ) #NEWLINE# if ( match is not None ) : #NEWLINE# #INDENT# return ( token , line , match ) #NEWLINE# #UNINDENT# #UNINDENT# raise ValueError ( ( 'line "%s" failed to lex' % token ) )