Crate mitex_parser
source ·Expand description
Given source strings, MiTeX Parser provides an AST (abstract syntax tree).
§Option: Command Specification
The parser retrieves a command specification which defines shape of commands. With the specification, the parser can parse commands correctly. Otherwise, all commands are parsed as barely names without arguments.
§Produce: AST
It returns an untyped syntax node representing the AST defined by rowan.
You can access the AST conveniently with interfaces provided by
rowan::SyntaxNode.
The untyped syntax node can convert to typed ones defined in
crate::syntax.
The untyped syntax node can also convert to rowan::cursor::SyntaxNode to
modify the AST syntactically.
Re-exports§
pub use mitex_spec as spec;
Modules§
- The character encoding used for argument matching
- The query module contains the data structures that are used by
typst query <mitex-packages> - Syntax kinds and typed syntax nodes
Structs§
- An archived
CmdShape - An archived
CommandSpec - An archived
CommandSpecRepr - An archived
EnvShape - An archived
GlobStr - Shape of a TeX command.
- The resolver for an archived
CmdShape - Command specification that is cheap to clone
- Command specification that contains a set of commands and environments.
- The resolver for an archived
CommandSpecRepr - The resolver for an archived
CommandSpec - Shape of a TeX envionment.
- The resolver for an archived
EnvShape - A shared string that represents a glob pattern.
- The resolver for an archived
GlobStr - Command specification that contains a set of commands and environments. It is used for us to define the meta data of LaTeX packages in typst code and query by
typst querythen. SeeSpecfor an example.
Enums§
- An archived
ArgPattern - An archived
ArgShape - An archived
CommandSpecItem - An archived
ContextFeature - An efficient pattern used for argument matching.
- The resolver for an archived
ArgPattern - Shape of arguments with direction to match since.
- The resolver for an archived
ArgShape - An item of command specification. It is either a normal command or an environment. See Command Syntax for concept of command. See Environment Syntax for concept of environment.
- The resolver for an archived
CommandSpecItem - A feature that specifies how to process the content of an environment.
- The resolver for an archived
ContextFeature
Functions§
- Parse the input text with the given command specification and return the untyped syntax tree
- It is only for internal testing