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

Method SourceInfo

cel/env.go:79–85  ·  view source on GitHub ↗

SourceInfo returns character offset and newline position information about expression elements.

()

Source from the content-addressed store, hash-verified

77
78// SourceInfo returns character offset and newline position information about expression elements.
79func (ast *Ast) SourceInfo() *exprpb.SourceInfo {
80 if ast == nil {
81 return nil
82 }
83 pbInfo, _ := celast.SourceInfoToProto(ast.NativeRep().SourceInfo())
84 return pbInfo
85}
86
87// ResultType returns the output type of the expression if the Ast has been type-checked, else
88// returns chkdecls.Dyn as the parse step cannot infer the type.

Callers 15

TestAstNilFunction · 0.95
reportCoverageFunction · 0.45
TestPruneFunction · 0.45
TestCheckFunction · 0.45
CheckFunction · 0.45
locationByIDMethod · 0.45
CheckMethod · 0.45
newProgramFunction · 0.45
AstToParsedExprFunction · 0.45
AstToStringFunction · 0.45

Calls 1

NativeRepMethod · 0.95

Tested by 8

TestAstNilFunction · 0.76
TestPruneFunction · 0.36
TestCheckFunction · 0.36
TestOptimizeWithSourceFunction · 0.36
TestExprToStringFunction · 0.36