def _get_url_node(parser, bits):
viewname = parser.compile_filter(bits[<NUM_LIT:1>])<EOL>args = []<EOL>kwargs = {}<EOL>bits = bits[<NUM_LIT:2>:]<EOL>if len(bits):<EOL><INDENT>kwarg_re = re.compile(r"<STR_LIT>")<EOL>for bit in bits:<EOL><INDENT>match = kwarg_re.match(bit)<EOL>if not match:<EOL><INDENT>raise TemplateSyntaxError("<STR_LIT>")<EOL><DEDENT>name, value = match.groups()<EOL>if name:<EOL><INDENT>kwargs[name] = parser.compile_filter(value)<EOL><DEDENT>else:<EOL><INDENT>args.append(parser.compile_filter(value))<EOL><DEDENT><DEDENT><DEDENT>return URLNode(viewname, args, kwargs, asvar=None)<EOL>
Parses the expression as if it was a normal url tag. Was copied
from the original function django.template.defaulttags.url,
but unnecessary pieces were removed.