(self, parser)
| 489 | tags = {"scope"} |
| 490 | |
| 491 | def parse(self, parser): |
| 492 | node = nodes.Scope(lineno=next(parser.stream).lineno) |
| 493 | assignments = [] |
| 494 | while parser.stream.current.type != "block_end": |
| 495 | lineno = parser.stream.current.lineno |
| 496 | if assignments: |
| 497 | parser.stream.expect("comma") |
| 498 | target = parser.parse_assign_target() |
| 499 | parser.stream.expect("assign") |
| 500 | expr = parser.parse_expression() |
| 501 | assignments.append(nodes.Assign(target, expr, lineno=lineno)) |
| 502 | node.body = assignments + list( |
| 503 | parser.parse_statements(("name:endscope",), drop_needle=True) |
| 504 | ) |
| 505 | return node |
| 506 | |
| 507 | env = Environment(extensions=[ScopeExt]) |
| 508 | tmpl = env.from_string( |
nothing calls this directly
no test coverage detected