MCPcopy
hub / github.com/x-motemen/gore / evalExpr

Method evalExpr

session.go:215–231  ·  view source on GitHub ↗
(in string)

Source from the content-addressed store, hash-verified

213}
214
215func (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
233func isNamedIdent(expr ast.Expr, name string) bool {
234 ident, ok := expr.(*ast.Ident)

Callers 3

EvalMethod · 0.95
actionTypeFunction · 0.80
actionDocFunction · 0.80

Calls 1

appendStatementsMethod · 0.95

Tested by

no test coverage detected