Sign in

    moonrockz/diagrams-mermaid/cst does not have a README file

    Element

    pub(all) enum Element {
    Token(Token)
    Node(Node)
    } derive(Eq,
    Debug
    )

    One element of a node: a token or a child node.

    Element::equal

    fn Element::equal(Element, Element) -> Bool

    Element::not_equal

    fn Element::not_equal(x : Element, y : Element) -> Bool

    Element::to_repr

    Node

    pub struct Node {
    kind : NodeKind
    children : ReadOnlyArray[Element]
    } derive(Eq,
    Debug
    )

    A node of the lossless syntax tree.

    Node::equal

    fn Node::equal(Node, Node) -> Bool

    Node::new

    fn Node::new(kind : NodeKind, children : ArrayView[Element]) -> Node

    A node. The node keeps a copy of children.

    Node::nodes

    fn Node::nodes(self : Node) -> Array[Node]

    The direct child nodes of this node.

    Node::not_equal

    fn Node::not_equal(x : Node, y : Node) -> Bool

    Node::range

    fn Node::range(self : Node) -> (Int, Int)?

    The UTF-16 offsets of the first code unit of this node and of the code unit after its last token. A node with no tokens gives None.

    Node::text

    fn Node::text(self : Node) -> String

    The source text of this node.

    Node::to_repr

    Node::tokens

    fn Node::tokens(self : Node) -> Array[Token]

    All tokens below this node, in source order.

    NodeKind

    pub(all) enum NodeKind {
    Document
    Header
    Participant
    Destroy
    Activate
    Deactivate
    Note
    Link
    Links
    Properties
    Details
    Title
    AccTitle
    AccDescr
    Autonumber
    Message
    Block
    BlockStart
    Section
    BlockEnd
    Error
    } derive(Eq,
    Debug
    )

    The kind of a node. A statement is one node. A frame, such as loop or box, is a Block node with a BlockStart, its statements, a Section node for each else, and or option, and a BlockEnd. Whitespace, line breaks, separators, comments, directives and front matter are tokens of the parent node.

    NodeKind::equal

    fn NodeKind::equal(NodeKind, NodeKind) -> Bool

    NodeKind::not_equal

    fn NodeKind::not_equal(x : NodeKind, y : NodeKind) -> Bool

    NodeKind::to_repr

    Token

    pub struct Token {
    kind : TokenKind
    text : String
    offset : Int
    } derive(Eq,
    Debug
    )

    One token. offset is the UTF-16 offset of its first code unit in the source. The concatenated token texts of a tree are equal to the source.

    Token::equal

    fn Token::equal(Token, Token) -> Bool

    Token::new

    fn Token::new(kind : TokenKind, text : String, offset : Int) -> Token

    A token.

    Token::not_equal

    fn Token::not_equal(x : Token, y : Token) -> Bool

    Token::to_repr

    TokenKind

    pub(all) enum TokenKind {
    Keyword
    Identifier
    Arrow
    Modifier
    Colon
    Comma
    Number
    Text
    ConfigOpen
    Config
    ConfigClose
    OpenBrace
    CloseBrace
    Whitespace
    Newline
    Separator
    Comment
    Directive
    FrontMatter
    Unknown
    } derive(Eq,
    Debug
    )

    The kind of a token in the lossless syntax tree.

    TokenKind::equal

    fn TokenKind::equal(TokenKind, TokenKind) -> Bool

    TokenKind::not_equal

    fn TokenKind::not_equal(x : TokenKind, y : TokenKind) -> Bool

    position

    fn position(source : String, offset : Int) ->
    Position

    The position of the UTF-16 offset offset in source. Lines and columns start at 1. \r\n, \n and a single \r each end a line.

    span

    fn span(source : String, start : Int, end : Int) ->
    Span

    The span from the UTF-16 offset start to end in source.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io