MCPcopy Create free account
hub / github.com/CloudyKit/jet / parseCatch

Method parseCatch

parse.go:1010–1024  ·  view source on GitHub ↗

catch: {{catch }} itemList {{end}} catch keyword is past.

()

Source from the content-addressed store, hash-verified

1008//
1009// catch keyword is past.
1010func (t *Template) parseCatch() *catchNode {
1011 line := t.lex.lineNumber()
1012 var errVar *IdentifierNode
1013 peek := t.peekNonSpace()
1014 if peek.typ != itemRightDelim {
1015 _errVar := t.term()
1016 if typ := _errVar.Type(); typ != NodeIdentifier {
1017 t.errorf("unexpected node type '%s' in catch", typ)
1018 }
1019 errVar = _errVar.(*IdentifierNode)
1020 }
1021 t.expectRightDelim("catch")
1022 list, _ := t.itemList(nodeEnd)
1023 return t.newCatch(peek.pos, line, errVar, list)
1024}
1025
1026// term:
1027//

Callers 1

actionMethod · 0.95

Calls 8

peekNonSpaceMethod · 0.95
termMethod · 0.95
errorfMethod · 0.95
expectRightDelimMethod · 0.95
itemListMethod · 0.95
newCatchMethod · 0.95
lineNumberMethod · 0.80
TypeMethod · 0.65

Tested by

no test coverage detected