MCPcopy Create free account
hub / github.com/cel-expr/cel-go / maybeQuoteField

Function maybeQuoteField

parser/unparser.go:72–77  ·  view source on GitHub ↗
(field string)

Source from the content-addressed store, hash-verified

70var identifierPartPattern *regexp.Regexp = regexp.MustCompile(`^[A-Za-z_][0-9A-Za-z_]*$`)
71
72func maybeQuoteField(field string) string {
73 if !identifierPartPattern.MatchString(field) || field == "in" {
74 return "`" + field + "`"
75 }
76 return field
77}
78
79// unparser visits an expression to reconstruct a human-readable string from an AST.
80type unparser struct {

Callers 2

visitSelectInternalMethod · 0.85
visitStructMsgMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected