Adds a token to a line. # Arguments `branch_id` - The line to add the token to `after` - The leaf to insert after (None for start of line) `kind` - The token kind `content` - The token content
(
&mut self,
_branch_id: crate::crdt::BranchId,
_after: Option<LeafId>,
_kind: TokenKind,
content: &[u8],
)
| 63 | /// * `kind` - The token kind |
| 64 | /// * `content` - The token content |
| 65 | pub fn add_token( |
| 66 | &mut self, |
| 67 | _branch_id: crate::crdt::BranchId, |
| 68 | _after: Option<LeafId>, |
| 69 | _kind: TokenKind, |
| 70 | content: &[u8], |
| 71 | ) -> LeafId { |
| 72 | let leaf_id = self.alloc_leaf_id(); |
| 73 | let _ = self.append_content(content); |
| 74 | |
| 75 | // Note: In a full implementation, we would add this to the branch's leaf ops |
| 76 | // For now, we just track the allocation and stats |
| 77 | self.stats.tokens_added += 1; |
| 78 | |
| 79 | leaf_id |
| 80 | } |
| 81 | |
| 82 | /// Marks a token for deletion. |
| 83 | pub fn delete_token(&mut self, _leaf_id: LeafId) { |