The new Decimal API

This commit is contained in:
Krasimir Angelov
2023-08-21 20:14:26 +02:00
parent 58da8deca8
commit fb398c603e
147 changed files with 918 additions and 188 deletions

View File

@@ -71,6 +71,7 @@ concrete CatSnd of Cat = CommonX - [Adv] ** open ResSnd, Prelude in {
Numeral = {s : CardOrd => Str ; n : Number} ;
Digits = {s : CardOrd => Str ; n : Number } ;
Decimal = {s : CardOrd => Str ; n : Number; hasDot : Bool} ;
---- Structural

View File

@@ -62,6 +62,7 @@ concrete NounSnd of Noun = CatSnd ** open ResSnd, Prelude in {
NumCard n = n ** {hasCard = True} ;
NumDigits n = {s = n.s ! NCard ; n = n.n} ;
NumDecimal n = {s = n.s ! NCard ; n = n.n} ;
OrdDigits n = {s = n.s ! NOrd; n = n.n} ;
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ;

View File

@@ -1,4 +1,4 @@
concrete NumeralSnd of Numeral = CatSnd [Numeral,Digits] ** open ResSnd, Prelude in {
concrete NumeralSnd of Numeral = CatSnd [Numeral,Digits,Decimal] ** open ResSnd, Prelude in {
-- By Harald Hammarstroem
-- Modification for Punjabi by Shafqat Virk
flags coding=utf8 ;
@@ -119,6 +119,7 @@ lin D_8 = { s = "۸" ; n = Pl};
lin D_9 = { s = "۹" ; n = Pl};
lin IDig d = { s = \\_ => d.s ; n = d.n} ;
lin IIDig d dg = { s = \\df => Prelude.glue (dg.s ! df) d.s ; n = Pl };
lin PosDecimal d = d ** {hasDot=False} ;
oper ekhazar : Str = variants {"ھزار" ; "ھڪ" ++ "ھزار"} ;
oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {singl => ekhazar ; _ => s ++ "ھزار"} ! sz ;