-
-
Notifications
You must be signed in to change notification settings - Fork 3
Custom number type #35
Copy link
Copy link
Open
Labels
code-generationInvolves generation of parser / serializer codeInvolves generation of parser / serializer codeenhancementEnhancement of existing featureEnhancement of existing feature
Metadata
Metadata
Assignees
Labels
code-generationInvolves generation of parser / serializer codeInvolves generation of parser / serializer codeenhancementEnhancement of existing featureEnhancement of existing feature
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$Sto zeroappendDigit- appends (decimal) digit$Xto the whole part ot$S- equivalent to10*$S+$X, $E isVALUE_OUT_OF_RANGEerror statementappendFractionalDigit- appends$I-th (decimal) fractional digit$Xto$S, if left blank, the type is assumed to be integer-onlysetExponent- multiplies$Sby 10 to the power of$XmakeNegative- changes the value to negative, guaranteed to be called at the endOr, instead of the last two, there could be
finalizewith arguments for sign and exponent.