Expand description
A native index of the MATLAB path: the functions, classes, scripts, live scripts,
packages (+pkg), class folders (@cls), plain folders and private folders that
MATLAB resolves names against. It is the Rust core of malt’s path index, and it has no
linter dependency.
Indexlists a search path up front and parses files lazily.parse_fileandparse_sourceturn one file into anEntity.parse_live_file,parse_live_text_fileandparse_live_bytesread live scripts (.mlxand plain-text live code).Sourcesreads the source lines of files, cached by path.dump::dumpwrites the index as JSON.
How MATLAB is read, the entities and the JSON schema are in the documentation at https://watermarkhu.nl/malt/api/.
Re-exports§
pub use config::ParserConfig;pub use error::IndexError;pub use expr::Expr;pub use hierarchy::Ancestor;pub use hierarchy::Inherited;pub use index::EntryId;pub use index::Index;pub use live::parse_live_bytes;pub use live::parse_live_file;pub use live::parse_live_text_file;pub use model::Argument;pub use model::ArgumentKind;pub use model::Detail;pub use model::Docstring;pub use model::Entity;pub use model::FunctionDetail;pub use model::Kind;pub use model::LiveSection;pub use model::PropertyDetail;pub use model::SectionKind;pub use parse::parse_file;pub use parse::parse_source;pub use paths::resolve_paths;pub use paths::PathConfig;pub use source::Sources;
Modules§
- comments
- Comment blocks as docstrings: which comment lines form the text, with the comment markers removed and the common indentation taken off.
- config
- Parser configuration: where the docstring of a declaration may sit, and whether live scripts on the path are read.
- dump
- The JSON dump of an index, in the schema of
docs/scripts/maxx_dump.py, so the two outputs can be compared (seedocs/scripts/compare_index.py). - error
- Errors of the index. Parsing MATLAB syntax never fails: tree-sitter recovers and the
parts that are not understood are skipped. A file that is not a readable live script
(a
.mlxthat is not a zip archive, or has no document) is aIndexError::Format. - expr
- Expressions: the source text of a type, default value, validator or base class, with the span it was read from.
- folder
- Plain folders as entities, and the lookup of a path.
- fsutil
- File system helpers shared by the index.
- hierarchy
- The class hierarchy: the method resolution order of a classdef, and the members a class inherits from its bases.
- index
- The index of a MATLAB search path.
- live
- Live scripts:
.mlxfiles and plain-text live code (.mfiles of MATLAB R2025a). - model
- The data model: what the index knows about a MATLAB path entry.
- parse
- Parsing one MATLAB file into entities, with tree-sitter.
- paths
- The folders on the search path:
[index] pathsin the working directory’s.malt.toml, the folder of the linted file, and extra folders. - source
- The source lines of files, read once and cached by path: the lines collection of maxx.