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

Method elseControl

parse.go:972–980  ·  view source on GitHub ↗

Else: {{else}} Else keyword is past.

()

Source from the content-addressed store, hash-verified

970//
971// Else keyword is past.
972func (t *Template) elseControl() Node {
973 // Special case for "else if".
974 peek := t.peekNonSpace()
975 if peek.typ == itemIf {
976 // We see "{{else if ... " but in effect rewrite it to {{else}}{{if ... ".
977 return t.newElse(peek.pos, t.lex.lineNumber())
978 }
979 return t.newElse(t.expectRightDelim("else").pos, t.lex.lineNumber())
980}
981
982// Try-catch:
983//

Callers 1

actionMethod · 0.95

Calls 4

peekNonSpaceMethod · 0.95
newElseMethod · 0.95
expectRightDelimMethod · 0.95
lineNumberMethod · 0.80

Tested by

no test coverage detected