Expand description
Syntax tree definitions with change metadata.
Structsยง
- Matched
Pos ๐ - Syntax
Info ๐Fields that are common to bothSyntax::ListandSyntax::Atom.
Enumsยง
- Atom
Kind ๐ - Match
Kind ๐A matched token (an atom, a delimiter, or a comment word). - String
Kind ๐Different types of strings. We want to diff these the same way, but highlight them differently. - Syntax ๐
- Token
Kind ๐Unlike atoms, tokens can be delimiters like{.
Functionsยง
- change_
positions ๐Walknodesand return a vec of all the changed positions. - change_
positions_ ๐ - comment_
positions ๐ - dbg_pos ๐
- filter_
empty_ ๐ends Skip line spans at the beginning or end that have zero width. - Assumes that
set_content_idhas already run. - has_
common_ ๐words Are there sufficient common words that we should only highlight individual changed words? - init_
all_ ๐info Initialise all the fields inSyntaxInfo. - init_
info ๐ - init_
info_ ๐on_ side Set all theSyntaxInfovalues for all therootson a single side (LHS or RHS). - init_
next_ ๐prev - print_
as_ ๐dot - print_
as_ ๐dot_ - set_
content_ ๐id - set_
next_ ๐sibling - set_
num_ ๐after - set_
num_ ๐ancestors - set_
parent ๐ - set_
prev ๐For every syntax node in the tree, mark the previous node according to a preorder traversal. - set_
prev_ ๐sibling - set_
unique_ ๐id - split_
atom_ ๐words Given the textcontentfrom a comment or string, split it intoMatchedPosvalues for the novel and unchanged words. - zip_
pad_ ๐shorter - zip_
repeat_ ๐shorter Ziplhswithrhs, but repeat the last item from the shorter slice.
Type Aliasesยง
- Content
Id ๐ - Content
Key ๐ - Syntax
Id ๐