//! Syntax layer for Lutra (layer L1). //! //! Parses PHP source with tree-sitter and derives the structure the rest of //! the IDE builds on: the outline (namespaces, classes, functions, members) //! and folding ranges. Highlighting in the editor is done by CodeMirror's //! Lezer grammar in the UI; this crate is the structural source for the //! outline, folding and the symbol index (see `docs/architecture.md`). //! //! Source text is untrusted: nothing here panics on broken PHP or random //! bytes. Files over [`MAX_PARSE_BYTES`] are not parsed; their [`Tree`] //! reports [`Tree::truncated`] and yields an empty outline. //! //! Positions are zero-based lines and columns counted in UTF-16 code units, //! converted through `lutra_text`. mod folding; mod outline; mod parser; mod range; pub use folding::folding; pub use outline::{ANONYMOUS_CLASS_NAME, OutlineItem, OutlineKind, outline}; pub use parser::{MAX_PARSE_BYTES, Parser, SyntaxError, Tree}; pub use range::Range;