Expand description
Lossless Kotlin syntax tree. Node and token kinds mirror the Kotlin compiler’s PSI element
types one-to-one (see kinds.tsv), so trees can be diffed against DebugUtil.psiToString.
Re-exports§
pub use tree::ElementId;pub use tree::Tree;pub use tree::TreeBuilder;
Modules§
- tree
Tree: a parsed file as flat preorder arrays. An element (node or token) is its preorder index; navigation is index arithmetic, and token text is a slice of the source. Replaces rowan’s green/red trees, which allocate per node when built and per step when walked (see research/06-tree-library.md for the measurements).
Structs§
- Parse
- A parsed file: the tree plus one message per
ERROR_ELEMENT, in tree preorder. - Text
Range - A range in text, represented as a pair of
TextSize. - Text
Size - A measure of text length. Also, equivalently, an index into text.
Enums§
Functions§
- psi_
dump - Renders
parseexactly like IntelliJ’sDebugUtil.psiToString(file, true, false), the format of the compiler’s parser fixtures and oftools/psi-dump.