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

Method action

parse.go:514–555  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

512}
513
514func (t *Template) action() (n Node) {
515 switch token := t.nextNonSpace(); token.typ {
516 case itemInclude:
517 return t.parseInclude()
518 case itemBlock:
519 return t.parseBlock()
520 case itemEnd:
521 return t.endControl()
522 case itemYield:
523 return t.parseYield()
524 case itemContent:
525 return t.contentControl()
526 case itemIf:
527 return t.ifControl()
528 case itemElse:
529 return t.elseControl()
530 case itemRange:
531 return t.rangeControl()
532 case itemTry:
533 return t.parseTry()
534 case itemCatch:
535 return t.parseCatch()
536 case itemReturn:
537 return t.parseReturn()
538 }
539
540 t.backup()
541 action := t.newAction(t.peek().pos, t.lex.lineNumber())
542
543 expr := t.assignmentOrExpression("command")
544 if expr.Type() == NodeSet {
545 action.Set = expr.(*SetNode)
546 expr = nil
547 if t.expectOneOf(itemSemicolon, itemRightDelim, "command", "semicolon or right delimiter").typ == itemSemicolon {
548 expr = t.expression("command", "pipeline base expression")
549 }
550 }
551 if expr != nil {
552 action.Pipe = t.pipeline("command", expr)
553 }
554 return action
555}
556
557func (t *Template) logicalExpression(context string) (Expression, item) {
558 left, endtoken := t.comparativeExpression(context)

Callers 1

textOrActionMethod · 0.95

Calls 15

nextNonSpaceMethod · 0.95
parseIncludeMethod · 0.95
parseBlockMethod · 0.95
endControlMethod · 0.95
parseYieldMethod · 0.95
contentControlMethod · 0.95
ifControlMethod · 0.95
elseControlMethod · 0.95
rangeControlMethod · 0.95
parseTryMethod · 0.95
parseCatchMethod · 0.95
parseReturnMethod · 0.95

Tested by

no test coverage detected