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

Function NewBufferAndLineOffsets

common/runes/buffer.go:136–139  ·  view source on GitHub ↗

NewBufferAndLineOffsets returns an efficient implementation of Buffer for the given text based on the ranges of the encoded code points contained within, as well as returning the line offsets.

(data string)

Source from the content-addressed store, hash-verified

134// NewBufferAndLineOffsets returns an efficient implementation of Buffer for the given text based on
135// the ranges of the encoded code points contained within, as well as returning the line offsets.
136func NewBufferAndLineOffsets(data string) (Buffer, []int32) {
137 buf, offs, _ := newBufferWithLimit(data, true, -1)
138 return buf, offs
139}
140
141// NewBufferAndLineOffsetsWithLimit returns an efficient implementation of Buffer for the given text
142// and enforces a code point limit while constructing the buffer.

Callers 1

NewStringSourceFunction · 0.92

Calls 1

newBufferWithLimitFunction · 0.85

Tested by

no test coverage detected