(in string)
| 213 | } |
| 214 | |
| 215 | func (s *Session) evalExpr(in string) (ast.Expr, error) { |
| 216 | expr, err := parser.ParseExpr(in) |
| 217 | if err != nil { |
| 218 | return nil, err |
| 219 | } |
| 220 | |
| 221 | stmt := &ast.ExprStmt{ |
| 222 | X: &ast.CallExpr{ |
| 223 | Fun: ast.NewIdent(printerName), |
| 224 | Args: []ast.Expr{expr}, |
| 225 | }, |
| 226 | } |
| 227 | |
| 228 | s.appendStatements(stmt) |
| 229 | |
| 230 | return expr, nil |
| 231 | } |
| 232 | |
| 233 | func isNamedIdent(expr ast.Expr, name string) bool { |
| 234 | ident, ok := expr.(*ast.Ident) |
no test coverage detected