Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Base10

Base-10 (decimal) encoding Parser/Writer factory.

Hierarchy

  • Base10

Index

Methods

Static countDigits

  • countDigits(value: number): number

Static decimalParser

  • decimalParser(): Parser<number>

Static decodeDigit

  • decodeDigit(c: number): number
  • Returns the decimal quantity between 0 (inclusive) and 10 (exclusive) represented by the base-10 digit c.

    throws

    Error if c is not a valid base-10 digit.

    Parameters

    • c: number

    Returns number

Static encodeDigit

  • encodeDigit(b: number): number
  • Returns the Unicode code point of the base-10 digit that encodes the given decimal quantity between 0 (inclusive) and 10 (exclusive).

    Parameters

    • b: number

    Returns number

Static integerParser

  • integerParser(): Parser<number>

Static integerWriter

  • integerWriter(): Writer<number, unknown>
  • integerWriter(input: number): Writer<unknown, number>

Static isDigit

  • isDigit(c: number): boolean

Static numberParser

  • numberParser(): Parser<number>

Static parseDecimal

Static parseInteger

Static parseNumber

Static writeInteger

  • writeInteger(input: number, output: Output): Writer<unknown, unknown>
  • Writes the base-10 (decimal) encoding of the input value to the output, returning a Writer continuation that knows how to write any remaining output that couldn't be immediately generated.

    Parameters

    • input: number
    • output: Output

    Returns Writer<unknown, unknown>