Adds break and continue to the template engine.
| 416 | |
| 417 | |
| 418 | class LoopControlExtension(Extension): |
| 419 | """Adds break and continue to the template engine.""" |
| 420 | tags = set(['break', 'continue']) |
| 421 | |
| 422 | def parse(self, parser): |
| 423 | token = next(parser.stream) |
| 424 | if token.value == 'break': |
| 425 | return nodes.Break(lineno=token.lineno) |
| 426 | return nodes.Continue(lineno=token.lineno) |
| 427 | |
| 428 | |
| 429 | class WithExtension(Extension): |
nothing calls this directly
no test coverage detected
searching dependent graphs…