Milky2018/diago/lexer does not have a README file

    LexError

    pub struct LexError {
    message : String
    range : Range
    } derive(Eq,
    Debug
    )

    Lexer error

    LexError::equal

    #deprecated("`LexError::equal` is deprecated, use `Eq::equal` instead.")
    fn LexError::equal(LexError, LexError) -> Bool

    LexError::not_equal

    #deprecated("`LexError::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn LexError::not_equal(x : LexError, y : LexError) -> Bool

    LexError::to_repr

    #deprecated("`LexError::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn LexError::to_repr(LexError) ->
    Repr

    Lexer

    type Lexer

    Lexer for the diago diagram language

    Lexer::new

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

    Create a new lexer for the given source (in-memory, no path)

    Lexer::tokenize

    fn Lexer::tokenize(self : Lexer) -> (Array[Token], Array[LexError])

    Tokenize the entire source and return tokens

    Lexer::with_path

    fn Lexer::with_path(path : String, source : String) -> Lexer

    Position

    pub struct Position {
    line : Int
    column : Int
    offset : Int
    } derive(Eq,
    Debug
    )

    Position in source code (0-based)

    offset is a 0-based codepoint offset within the source string.

    Position::equal

    #deprecated("`Position::equal` is deprecated, use `Eq::equal` instead.")
    fn Position::equal(Position, Position) -> Bool

    Position::new

    fn Position::new(line : Int, column : Int, offset : Int) -> Position

    Position::not_equal

    #deprecated("`Position::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn Position::not_equal(x : Position, y : Position) -> Bool

    Position::to_repr

    #deprecated("`Position::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn Position::to_repr(Position) ->
    Repr

    Position::zero

    fn Position::zero() -> Position

    Create a simple position at the origin

    Range

    pub struct Range {
    path : String
    start : Position
    end : Position
    } derive(Eq,
    Debug
    )

    A range in source code from start to end position. path may be empty for in-memory sources.

    Range::between

    fn Range::between(a : Range, b : Range) -> Range

    Create a range from the start of a to the end of b.

    Range::equal

    #deprecated("`Range::equal` is deprecated, use `Eq::equal` instead.")
    fn Range::equal(Range, Range) -> Bool

    Range::new

    fn Range::new(start : Position, end : Position) -> Range

    Range::not_equal

    #deprecated("`Range::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn Range::not_equal(x : Range, y : Range) -> Bool

    Range::to_repr

    #deprecated("`Range::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn Range::to_repr(Range) ->
    Repr

    Range::with_path

    fn Range::with_path(path : String, start : Position, end : Position) -> Range

    StringType

    pub enum StringType {
    SingleQuoted
    DoubleQuoted
    } derive(Eq,
    Debug
    )

    String literal types

    StringType::equal

    #deprecated("`StringType::equal` is deprecated, use `Eq::equal` instead.")
    fn StringType::equal(StringType, StringType) -> Bool

    StringType::not_equal

    #deprecated("`StringType::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn StringType::not_equal(x : StringType, y : StringType) -> Bool

    StringType::to_repr

    #deprecated("`StringType::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn StringType::to_repr(StringType) ->
    Repr

    Token

    pub struct Token {
    kind : TokenKind
    range : Range
    raw : String
    } derive(Eq,
    Debug
    )

    A token with its kind, range, and raw text

    Token::equal

    #deprecated("`Token::equal` is deprecated, use `Eq::equal` instead.")
    fn Token::equal(Token, Token) -> Bool

    Token::is_arrow

    fn Token::is_arrow(self : Token) -> Bool

    Check if a token is an arrow

    Token::is_edge_op

    fn Token::is_edge_op(self : Token) -> Bool

    Check if a token can start an edge

    Token::is_trivia

    fn Token::is_trivia(self : Token) -> Bool

    Check if a token is a trivia token (whitespace, comments)

    Token::new

    fn Token::new(kind : TokenKind, range : Range, raw : String) -> Token

    Token::not_equal

    #deprecated("`Token::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn Token::not_equal(x : Token, y : Token) -> Bool

    Token::to_repr

    #deprecated("`Token::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn Token::to_repr(Token) ->
    Repr

    TokenKind

    pub enum TokenKind {
    Ident(String)
    StringLit(StringType, String)
    Number(String)
    Colon
    Semicolon
    Dot
    Comma
    LeftBrace
    RightBrace
    LeftBracket
    RightBracket
    LeftParen
    RightParen
    Pipe
    Ampersand
    Arrow
    ReverseArrow
    BidirectionalArrow
    DoubleDash
    Comment(String)
    BlockComment(String)
    At
    DotDotDot
    Dollar
    DollarBrace
    Star
    DoubleStar
    TripleStar
    Newline
    Eof
    } derive(Eq,
    Debug
    )

    Token types for the diago language

    TokenKind::equal

    #deprecated("`TokenKind::equal` is deprecated, use `Eq::equal` instead.")
    fn TokenKind::equal(TokenKind, TokenKind) -> Bool

    TokenKind::not_equal

    #deprecated("`TokenKind::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn TokenKind::not_equal(x : TokenKind, y : TokenKind) -> Bool

    TokenKind::to_repr

    #deprecated("`TokenKind::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn TokenKind::to_repr(TokenKind) ->
    Repr

    tokenize

    fn tokenize(source : String) -> (Array[Token], Array[LexError])

    Convenience function to tokenize a string

    tokenize_with_path

    fn tokenize_with_path(path : String, source : String) -> (Array[Token], Array[LexError])

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io