()
| 856 | } |
| 857 | |
| 858 | func (t *Template) parseArguments() (args CallArgs) { |
| 859 | context := "call expression argument list" |
| 860 | args.Exprs = []Expression{} |
| 861 | loop: |
| 862 | for { |
| 863 | peek := t.peekNonSpace() |
| 864 | if peek.typ == itemRightParen { |
| 865 | break |
| 866 | } |
| 867 | var ( |
| 868 | expr Expression |
| 869 | endtoken item |
| 870 | ) |
| 871 | expr, endtoken = t.parseExpression(context) |
| 872 | if expr.Type() == NodeUnderscore { |
| 873 | // slot for piped argument |
| 874 | if args.HasPipeSlot { |
| 875 | t.errorf("found two pipe slot markers ('_') for the same function call") |
| 876 | } |
| 877 | args.HasPipeSlot = true |
| 878 | } |
| 879 | args.Exprs = append(args.Exprs, expr) |
| 880 | switch endtoken.typ { |
| 881 | case itemComma: |
| 882 | // continue with closing parens (allowed because of multiline syntax) or next arg |
| 883 | default: |
| 884 | t.backup() |
| 885 | break loop |
| 886 | } |
| 887 | } |
| 888 | return |
| 889 | } |
| 890 | |
| 891 | func (t *Template) parseControl(allowElseIf bool, context string) (pos Pos, line int, set *SetNode, expression Expression, list, elseList *ListNode) { |
| 892 | line = t.lex.lineNumber() |
no test coverage detected