Files
releases/vendor/github.com/kr/text
Philip Conrad 47a13c4f8c internal+json.filter: Add EditTree data structure. (#5494)
This commit adds a new `EditTree` data structure, which is built
for applying in-place modifications to a Term, and can render the
final result of all the edits efficiently.

The goal is to use this data structure to apply *all* of the patches in
a JSON-Patch sequence rapidly, and then collapse all of the edits at
the end with minimal wasted Term copying.

The `EditTree` data structure supports the following core operations:

 - Insert
 - Delete
 - Unfold
 - Render

It is designed to work across all core Rego data types, with special-
case handling for scalars versus composite types.

It also vendors in a bit-vector library to allow for ease-of-
bookkeeping for in-place Array modifications.

As an example of usage, `json.filter`'s builtin implementation has been
replaced with an `EditTree`-based design, which scales well on
deeply-nested paths, relative to the original implementation.

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2023-02-14 15:30:59 -05:00
..

This is a Go package for manipulating paragraphs of text.

See http://go.pkgdoc.org/github.com/kr/text for full documentation.