Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom number type #35

Open
Chlumsky opened this issue Mar 26, 2023 · 0 comments
Open

Custom number type #35

Chlumsky opened this issue Mar 26, 2023 · 0 comments
Labels
code-generation Involves generation of parser / serializer code enhancement Enhancement of existing feature

Comments

@Chlumsky
Copy link
Owner

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.

@Chlumsky Chlumsky added enhancement Enhancement of existing feature code-generation Involves generation of parser / serializer code labels Mar 26, 2023
@Chlumsky Chlumsky added this to Low Priority in Development progress Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-generation Involves generation of parser / serializer code enhancement Enhancement of existing feature
Projects
Development

No branches or pull requests

1 participant