()
| 384 | } |
| 385 | |
| 386 | func (t *Template) parseBlock() Node { |
| 387 | const context = "block clause" |
| 388 | var pipe Expression |
| 389 | |
| 390 | name := t.expect(itemIdentifier, context, "name") |
| 391 | bplist := t.blockParametersList(true, context) |
| 392 | |
| 393 | if t.peekNonSpace().typ != itemRightDelim { |
| 394 | pipe = t.expression(context, "context") |
| 395 | } |
| 396 | |
| 397 | t.expectRightDelim(context) |
| 398 | |
| 399 | list, end := t.itemList(nodeContent, nodeEnd) |
| 400 | var contentList *ListNode |
| 401 | |
| 402 | if end.Type() == nodeContent { |
| 403 | contentList, _ = t.itemList(nodeEnd) |
| 404 | } |
| 405 | |
| 406 | block := t.newBlock(name.pos, t.lex.lineNumber(), name.val, bplist, pipe, list, contentList) |
| 407 | t.passedBlocks[block.Name] = block |
| 408 | return block |
| 409 | } |
| 410 | |
| 411 | func (t *Template) parseYield() Node { |
| 412 | const context = "yield clause" |
no test coverage detected