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§
- argument_
kind - The character encoding used for argument matching
- command_
preludes - preludes
- query
- The query module contains the data structures that are used by
typst query <mitex-packages>
- syntax
- Syntax kinds and typed syntax nodes
Structs§
- Archived
CmdShape - An archived
CmdShape
- Archived
Command Spec - An archived
CommandSpec
- Archived
Command Spec Repr - An archived
CommandSpecRepr
- Archived
EnvShape - An archived
EnvShape
- Archived
Glob Str - An archived
GlobStr
- CmdShape
- Shape of a TeX command.
- CmdShape
Resolver - The resolver for an archived
CmdShape
- Command
Spec - Command specification that is cheap to clone
- Command
Spec Repr - Command specification that contains a set of commands and environments.
- Command
Spec Repr Resolver - The resolver for an archived
CommandSpecRepr
- Command
Spec Resolver - The resolver for an archived
CommandSpec
- EnvShape
- Shape of a TeX envionment.
- EnvShape
Resolver - The resolver for an archived
EnvShape
- GlobStr
- A shared string that represents a glob pattern.
- Glob
StrResolver - The resolver for an archived
GlobStr
- Json
Command Spec - 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 query
then. SeeSpec
for an example.
Enums§
- Archived
ArgPattern - An archived
ArgPattern
- Archived
ArgShape - An archived
ArgShape
- Archived
Command Spec Item - An archived
CommandSpecItem
- Archived
Context Feature - An archived
ContextFeature
- ArgPattern
- An efficient pattern used for argument matching.
- ArgPattern
Resolver - The resolver for an archived
ArgPattern
- ArgShape
- Shape of arguments with direction to match since.
- ArgShape
Resolver - The resolver for an archived
ArgShape
- Command
Spec Item - 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.
- Command
Spec Item Resolver - The resolver for an archived
CommandSpecItem
- Context
Feature - A feature that specifies how to process the content of an environment.
- Context
Feature Resolver - The resolver for an archived
ContextFeature
Functions§
- parse
- Parse the input text with the given command specification and return the untyped syntax tree
- parse_
without_ macro - It is only for internal testing