MCPcopy Create free account
hub / github.com/expr-lang/expr / Visit

Method Visit

patcher/with_timezone.go:14–25  ·  view source on GitHub ↗
(node *ast.Node)

Source from the content-addressed store, hash-verified

12}
13
14func (t WithTimezone) Visit(node *ast.Node) {
15 if btin, ok := (*node).(*ast.BuiltinNode); ok {
16 switch btin.Name {
17 case "date", "now":
18 loc := &ast.ConstantNode{Value: t.Location}
19 ast.Patch(node, &ast.BuiltinNode{
20 Name: btin.Name,
21 Arguments: append([]ast.Node{loc}, btin.Arguments...),
22 })
23 }
24 }
25}

Callers

nothing calls this directly

Calls 1

PatchFunction · 0.92

Tested by

no test coverage detected