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

Method AddExtension

common/ast/ast.go:463–473  ·  view source on GitHub ↗

AddExtension adds an extension record into the SourceInfo.

(ext Extension)

Source from the content-addressed store, hash-verified

461
462// AddExtension adds an extension record into the SourceInfo.
463func (s *SourceInfo) AddExtension(ext Extension) {
464 if s == nil {
465 return
466 }
467 for _, e := range s.extensions {
468 if e.ID == ext.ID && e.Version == ext.Version && slices.Equal(e.Components, ext.Components) {
469 return
470 }
471 }
472 s.extensions = append(s.extensions, ext)
473}
474
475// OffsetRange captures the start and stop positions of a section of text in the input expression.
476type OffsetRange struct {

Callers 6

TestHasExtensionFunction · 0.95
ProtoToSourceInfoFunction · 0.95
OptimizeMethod · 0.45
OptimizeMethod · 0.45
CheckFunction · 0.45
sourceWithExtensionFunction · 0.45

Calls 1

EqualMethod · 0.65

Tested by 2

TestHasExtensionFunction · 0.76
sourceWithExtensionFunction · 0.36