SongYZZZ/moon-firmware/codec does not have a README file

    LineEnding

    pub(all) enum LineEnding {
    LF
    CRLF
    } derive(Eq,
    Debug
    )

    Only standard line endings are emitted by the text writers.

    Location

    pub(all) struct Location {
    format :
    Format

    line : Int
    column_offset : Int
    record_type : Int?
    } derive(Eq,
    Debug
    )

    Context shared by the two record grammars. Locations use ASCII columns.

    Location::error

    Construct a source-bound failure, retaining structured parser context.

    SourceLine

    pub(all) struct SourceLine {
    text : String
    location : Location
    }

    Normalized line plus its original starting column after permissive trim.

    TextOutput

    pub struct TextOutput {
    // private fields
    }

    Bounded text sink shared by format writers; never stores an array of lines.

    TextOutput::finish

    fn TextOutput::finish(self : TextOutput) -> String

    Finish deterministic ASCII text after all record checks succeed.

    TextOutput::new

    Validate output budget before allocation. The hard limit is 256 Mi characters.

    TextOutput::write_line

    fn TextOutput::write_line(self : TextOutput, line : String) -> Unit raise
    FirmwareError

    Check incremental encoded size before adding each bounded protocol record.

    address_bytes

    fn address_bytes(value : Int64, width : Int) -> Bytes raise
    FirmwareError

    Serialize only addresses representable in the requested width.

    decode_hex

    fn decode_hex(text : String, start : Int, location : Location) -> Bytes raise
    FirmwareError

    Decode an exact even number of digits, reporting the first bad column.

    encode_hex

    fn encode_hex(bytes : Bytes, uppercase? : Bool) -> String

    Encode bytes as plain hexadecimal digits for record bodies and previews.

    for_each_line

    Iterate bounded lines without splitting a large document into an array. Permissive mode accepts ASCII outer whitespace, blank/comment lines and BOM. Every tolerance creates a warning. LF and CRLF are supported in both modes.

    hex_digit

    fn hex_digit(code : UInt16) -> Int?

    Decode one ASCII digit without locale or Unicode lookalike acceptance.

    locate_error

    Reattach source context to an address or overlap failure from the model.

    parse_number

    fn parse_number(text : String, max_value? : Int64) -> Int64 raise
    FirmwareError

    Parse a decimal or 0x-prefixed unsigned address without overflow.

    read_address

    fn read_address(bytes : Bytes, offset : Int, width : Int) -> Int64 raise
    FirmwareError

    Decode a big-endian address of 1..4 bytes from a validated record.

    write_hex_byte

    fn write_hex_byte(out : StringBuilder, byte : Byte, uppercase : Bool) -> Unit

    Append one encoded byte. The alphabet is shared; checksums are not.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io