Skip to content

Commit 4b29a6b

Browse files
committed
Update design document to reflect latest code changes.
1 parent 0b6241d commit 4b29a6b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

design/design.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Public-facing:
1313
- `src/slice.rs`: implementation of `RopeSlice`.
1414
- `src/iter.rs`: implementations of all the iterators.
1515
- `src/rope_builder.rs`: implementation of `RopeBuilder`.
16+
- `src/str_utils.rs`: utility functions that operate on `&str` slices. For example, functions to count chars and line endings.
1617

1718
Internal-only:
1819
- `src/tree/`: the low-level implementation of `Rope`'s internals, where most of the meat of the b-tree rope is.
19-
- `src/str_utils.rs`: utility functions that operate on `&str` slices. For example, functions to count chars and line endings.
2020

2121

2222
## B-tree Rope
@@ -125,9 +125,10 @@ Phew! Hopefully that all made sense.
125125

126126
Most of the logic for traversing and modifying the tree is implemented in `node.rs` as part of `Node`. As a general rule, code that needs to know which node is root is implemented in `Rope`, code that otherwise traverses or modifies the tree is implemented in `Node`, and code that only deals with a single node is implemented in `NodeText` and `NodeChildren`.
127127

128-
The four main functions to really pay attention to are part of `Node`:
128+
The five main functions to really pay attention to are part of `Node`:
129129

130-
- `Node::edit_char_range()`
130+
- `Node::edit_chunk_at_char()`
131+
- `Node::remove_char_range()`
131132
- `Node::split()`
132133
- `Node::prepend_at_depth()`
133134
- `Node::append_at_depth()`.
@@ -137,7 +138,7 @@ These are by far the most complex code in Ropey, and are the core editing operat
137138

138139
## Tree Invariants
139140

140-
The invariants of the tree that must hold true for the tree to operate correctly are:
141+
The following invariants must hold true for the tree to operate correctly:
141142

142143
- The standard b-tree invariants:
143144
- All leaf nodes must be at the same depth.

0 commit comments

Comments
 (0)