Expand description

Syntax tree definitions with change metadata.


MatchedPos 🔒
SyntaxInfo 🔒
Fields that are common to both Syntax::List and Syntax::Atom.


AtomKind 🔒
MatchKind 🔒
A matched token (an atom, a delimiter, or a comment word).
StringKind 🔒
Different types of strings. We want to diff these the same way, but highlight them differently.
Syntax 🔒
TokenKind 🔒
Unlike atoms, tokens can be delimiters like {.


Walk nodes and return a vec of all the changed positions.
dbg_pos 🔒
Skip line spans at the beginning or end that have zero width.
Assumes that set_content_id has already run.
Are there sufficient common words that we should only highlight individual changed words?
Initialise all the fields in SyntaxInfo.
init_info 🔒
Set all the SyntaxInfo values for all the roots on a single side (LHS or RHS).
set_parent 🔒
set_prev 🔒
For every syntax node in the tree, mark the previous node according to a preorder traversal.
Given the text content from a comment or strings, split it into MatchedPos values for the novel and unchanged words.
Zip lhs with rhs, but repeat the last item from the shorter slice.

Type Definitions

ContentKey 🔒
SyntaxId 🔒