Skip to content

Custom number type #35

@Chlumsky

Description

@Chlumsky

Add the possibility to define custom number types (integer or real), e.g. a dynamic-sized "big integer" type. The parser API could look like this:

  • clear - sets $S to zero
  • appendDigit - appends (decimal) digit $X to the whole part ot $S - equivalent to 10*$S+$X, $E is VALUE_OUT_OF_RANGE error statement
  • appendFractionalDigit - appends $I-th (decimal) fractional digit $X to $S, if left blank, the type is assumed to be integer-only
  • setExponent - multiplies $S by 10 to the power of $X
  • makeNegative - changes the value to negative, guaranteed to be called at the end

Or, instead of the last two, there could be finalize with arguments for sign and exponent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-generationInvolves generation of parser / serializer codeenhancementEnhancement of existing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions