Currently we skip an extra comma when "with context" is not provided to
the "from" statement. This allows invalid code such as this:
{% from "functions.html" import my_function,, %}
The primary issue with this is that it is not consistent when providing
"with context". The following code throws an error, contrary to the
previous example:
{% from "functions.html" import my_function,, with context %}
It seems that the comma skipping was originally found in
0611e49 and was
accidentally put inside the "with context" check in
ea847c5. It was then
updated to use "skip_if" in
fdf9530.
There doesn't seem to be any reason for this check existing, as
double commas should never be allowed and serve no purpose in the
statement.
self.stream.expect('name')
if not hasattr(node, 'with_context'):
node.with_context = False
- self.stream.skip_if('comma')
return node
def parse_signature(self, node):