textOrAction: text | action
()
| 500 | // |
| 501 | // text | action |
| 502 | func (t *Template) textOrAction() Node { |
| 503 | switch token := t.nextNonSpace(); token.typ { |
| 504 | case itemText: |
| 505 | return t.newText(token.pos, token.val) |
| 506 | case itemLeftDelim: |
| 507 | return t.action() |
| 508 | default: |
| 509 | t.unexpected(token, "input", "text or action") |
| 510 | } |
| 511 | return nil |
| 512 | } |
| 513 | |
| 514 | func (t *Template) action() (n Node) { |
| 515 | switch token := t.nextNonSpace(); token.typ { |
no test coverage detected