(b []byte)
| 113 | } |
| 114 | |
| 115 | func parseFuncCall(b []byte) (*funcType, error) { |
| 116 | exprStr := string(b) |
| 117 | expr, err := goparser.ParseExpr(exprStr) |
| 118 | if err != nil { |
| 119 | return nil, err |
| 120 | } |
| 121 | ce, ok := expr.(*ast.CallExpr) |
| 122 | if !ok { |
| 123 | return nil, fmt.Errorf("missing function call") |
| 124 | } |
| 125 | callPrefix, name, err := getCallName(ce) |
| 126 | if err != nil { |
| 127 | return nil, err |
| 128 | } |
| 129 | argNames := exprStr[ce.Lparen : ce.Rparen-1] |
| 130 | |
| 131 | if len(argNames) > 0 { |
| 132 | argNames = ", " + argNames |
| 133 | } |
| 134 | return &funcType{ |
| 135 | name: name, |
| 136 | callPrefix: callPrefix, |
| 137 | argNames: argNames, |
| 138 | }, nil |
| 139 | } |
| 140 | |
| 141 | func (f *funcType) DefStream(dst string) string { |
| 142 | return fmt.Sprintf("%s%s%s(%s *qt%s.Writer%s)", f.defPrefix, f.prefixStream(), f.name, dst, mangleSuffix, f.args) |
searching dependent graphs…