Expand description
Parser and syntax tree for Typst.
Modules§
Structs§
- FileId
- Identifies a file in a project or package.
- Lines
- A text buffer and metadata about lines.
- LinkedChildren 
- An iterator over the children of a linked node.
- LinkedNode 
- A syntax node in a context.
- Source
- A source file.
- Span
- Defines a range in a file.
- Spanned
- A value with a span locating it in the source code.
- SyntaxError 
- A syntactical error.
- SyntaxNode 
- A node in the untyped syntax tree.
- VirtualPath 
- An absolute path in the virtual file system of a project or package.
Enums§
- Side
- Indicates whether the cursor is before the related byte index, or after.
- SyntaxKind 
- A syntactical building block of a Typst file.
- SyntaxMode 
- The syntax mode of a portion of Typst code.
- Tag
- A syntax highlighting tag.
Functions§
- highlight
- Determine the highlight tag of a linked syntax node.
- highlight_html 
- Highlight a node to an HTML codeelement.
- is_id_ continue 
- Whether a character can continue an identifier.
- is_id_ start 
- Whether a character can start an identifier.
- is_ident 
- Whether a string is a valid Typst identifier.
- is_newline 
- Whether a character is interpreted as a newline by Typst.
- is_valid_ label_ literal_ id 
- Returns true if this string is valid in a label literal.
- link_prefix 
- Extracts a prefix of the text that is a link and also returns whether the parentheses and brackets in the link were balanced.
- parse
- Parses a source file as top-level markup.
- parse_code 
- Parses top-level code.
- parse_math 
- Parses top-level math.
- split_newlines 
- Split text at newlines. These newline characters are not kept.