Skip to main content

Crate malt_index

Crate malt_index 

Source
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.

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 (see docs/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 .mlx that is not a zip archive, or has no document) is a IndexError::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: .mlx files and plain-text live code (.m files 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] paths in 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.