Implement {% for ... %}
This commit is contained in:
parent
269f0a6e8f
commit
864217a9bd
@ -79,6 +79,13 @@ class Parser:
|
|||||||
# {% endblock %}
|
# {% endblock %}
|
||||||
self.emitter.end_block()
|
self.emitter.end_block()
|
||||||
self.in_html = False
|
self.in_html = False
|
||||||
|
elif command.startswith('for '):
|
||||||
|
# {% for ... %}
|
||||||
|
for_defn = command[len('if '):].strip()
|
||||||
|
self.emitter.emit('for (' + for_defn + ') {')
|
||||||
|
elif command == 'endfor':
|
||||||
|
# {% endfor %}
|
||||||
|
self.emitter.emit('}')
|
||||||
elif command.startswith('if '):
|
elif command.startswith('if '):
|
||||||
# {% if ... %}
|
# {% if ... %}
|
||||||
condition = command[len('if '):].strip()
|
condition = command[len('if '):].strip()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user