def compile_string(template_string, origin):
 if settings.TEMPLATE_DEBUG:
  from debug import DebugLexer, DebugParser
  (lexer_class, parser_class) = (DebugLexer, DebugParser)
 else:
  (lexer_class, parser_class) = (Lexer, Parser)
 lexer = lexer_class(template_string, origin)
 parser = parser_class(lexer.tokenize())
 return parser.parse()

def compile_string ( template_string , origin ) : if settings . TEMPLATE_DEBUG : from debug import DebugLexer , DebugParser ( lexer_class , parser_class ) = ( DebugLexer , DebugParser ) else : ( lexer_class , parser_class ) = ( Lexer , Parser ) lexer = lexer_class ( template_string , origin ) parser = parser_class ( lexer . tokenize ( ) ) return parser . parse ( )
compiles template_string into nodelist ready for rendering .