Expand description
Syntax tree definitions with change metadata.
Structs
Fields that are common to both
Syntax::List
and Syntax::Atom
.Enums
AtomKind 🔒
A matched token (an atom, a delimiter, or a comment word).
Different types of strings. We want to diff these the same way,
but highlight them differently.
Syntax 🔒
Unlike atoms, tokens can be delimiters like
{
.Functions
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
.Set all the
SyntaxInfo
values for all the roots
on a single
side (LHS or RHS).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
SyntaxId 🔒