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

Function NewBuffer

common/runes/buffer.go:129–132  ·  view source on GitHub ↗

NewBuffer returns an efficient implementation of Buffer for the given text based on the ranges of the encoded code points contained within.

(data string)

Source from the content-addressed store, hash-verified

127// NewBuffer returns an efficient implementation of Buffer for the given text based on the ranges of
128// the encoded code points contained within.
129func NewBuffer(data string) Buffer {
130 buf, _, _ := newBufferWithLimit(data, false, -1)
131 return buf
132}
133
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.

Callers 7

ParseMethod · 0.92
NewInfoSourceFunction · 0.92
TestNewBuffer_ASCIIFunction · 0.85
TestNewBuffer_BasicFunction · 0.85
TestNewBuffer_AllFunction · 0.85
TestNewBuffer_EmptyFunction · 0.85

Calls 1

newBufferWithLimitFunction · 0.85

Tested by 5

TestNewBuffer_ASCIIFunction · 0.68
TestNewBuffer_BasicFunction · 0.68
TestNewBuffer_AllFunction · 0.68
TestNewBuffer_EmptyFunction · 0.68