Sign in

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

    Element

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

    Element::equal

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

    Element::not_equal

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

    Element::to_repr

    Lines

    pub struct Lines {
    // private fields
    }

    A line index of a source text for UTF-16 positions.

    Lines::new

    fn Lines::new(source : String) -> Lines

    Lines::position

    fn Lines::position(self : Lines, offset : Int) ->
    Position

    The position of a UTF-16 offset. Lines and columns start at 1; columns count UTF-16 code units. A CR before LF belongs to its line.

    Lines::span

    fn Lines::span(self : Lines, start : Int, end : Int) ->
    Span

    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

    Node::nodes

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

    The child nodes of the node.

    Node::not_equal

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

    Node::range

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

    The half-open UTF-16 range of the node, or None for an empty node.

    Node::text

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

    The source text of the node.

    Node::to_repr

    Node::tokens

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

    All tokens of the node in source order, without recursion.

    NodeKind

    pub(all) enum NodeKind {
    Document
    Start
    End
    Title
    Caption
    Header
    Footer
    Legend
    Skinparam
    Style
    Pragma
    Scale
    Hide
    Comment
    Directive
    Highlight
    Pattern
    Rule
    Note
    Data
    Blank
    Trailing
    Error
    } derive(Eq,
    Debug
    )

    The kind of a node. Each source line, or each multi-line statement, is one node under the document.

    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

    Token::not_equal

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

    Token::to_repr

    TokenKind

    pub(all) enum TokenKind {
    Marker
    Keyword
    Name
    Text
    String
    Number
    Literal
    Escape
    Operator
    Punctuation
    Comment
    Whitespace
    Newline
    Directive
    Error
    } derive(Eq,
    Debug
    )

    The kind of a token in the lossless syntax tree. All four body languages share these kinds.

    TokenKind::equal

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

    TokenKind::not_equal

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

    slice

    fn slice(text : String, start : Int, end : Int) -> String

    The owned text of the half-open UTF-16 range start to end of text.

    span

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

    The span of a half-open UTF-16 range of source.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io