diff --git a/Setup.hs b/Setup.hs index fb61988b8..5852eae0f 100644 --- a/Setup.hs +++ b/Setup.hs @@ -60,7 +60,7 @@ rglCommands = mapM_ (gfc mode pkg lbi . compat) (optl langsCompat args) , RGLCommand "api" True $ \mode args pkg lbi -> do mapM_ (gfc mode pkg lbi . try) (optl langsAPI args) - mapM_ (gfc mode pkg lbi . symbolic) (optl langsAPI args) + mapM_ (gfc mode pkg lbi . symbolic) (optl langsSymbolic args) , RGLCommand "pgf" False $ \mode args pkg lbi -> do let dir = getRGLBuildDir lbi mode createDirectoryIfMissing True dir @@ -208,7 +208,10 @@ langs = map fst langsCoding langsLang = langs `except` ["Amh","Ara","Lat","Hin","Tha","Tur","Urd"] -- languages for which to compile Try -langsAPI = langsLang `except` ["Hin","Ina","Rus","Tha"] +langsAPI = langsLang `except` ["Hin","Ina","Tha"] + +-- languages for which to compile Symbolic +langsSymbolic = langsAPI `except` ["Rus"] -- languages for which to run demo test langsDemo = langsLang `except` ["Ara","Hin","Ina","Tha"] @@ -310,7 +313,7 @@ unlexer abstr ls = -- | Runs the gf executable in compile mode with the given arguments. run_gfc :: PackageDescription -> LocalBuildInfo -> [String] -> IO () run_gfc pkg lbi args = - do let args' = ["-batch","-src","-gf-lib-path="++rgl_src_dir,"+RTS","-K32M","-RTS"] ++ filter (not . null) args + do let args' = ["-batch","-gf-lib-path="++rgl_src_dir,"+RTS","-K32M","-RTS"] ++ filter (not . null) args gf = default_gf pkg lbi putStrLn $ "Running: " ++ gf ++ " " ++ unwords (map showArg args') e <- rawSystem gf args' diff --git a/lib/src/Make.hs b/lib/src/Make.hs index 5e272fb24..aac053099 100644 --- a/lib/src/Make.hs +++ b/lib/src/Make.hs @@ -154,7 +154,7 @@ gfc pres ppath file = do let preproc = if pres then "-preproc=mkPresent" else "" let path = if pres then ppath else "" putStrLn $ "Compiling " ++ file - run_gfc ["-s","-src", preproc, path, file] + run_gfc ["-s","-src",preproc, path, file] gfcmin path file = do let preproc = "-preproc=mkMinimal" diff --git a/lib/src/api/Constructors.gf b/lib/src/api/Constructors.gf index 4970d64a4..1a63dc206 100644 --- a/lib/src/api/Constructors.gf +++ b/lib/src/api/Constructors.gf @@ -1646,13 +1646,18 @@ oper Predef.PFalse => NumDigits (str2digits s) } ; - str2numeral : Str -> Numeral = (\s -> case s of { - m@(? + _) + "000" => num (pot3 (s2s1000 m)) ; - m@(? + _) + "00" + n@? => num (pot3plus (s2s1000 m) (s2s1000 n)) ; - m@(? + _) + "0" + n@(? + ?) => num (pot3plus (s2s1000 m) (s2s1000 n)) ; - m@(? + _) + n@(? + ? + ?) => num (pot3plus (s2s1000 m) (s2s1000 n)) ; - _ => num (pot2as3 (s2s1000 s)) - }) + str2numeral : Str -> Numeral = +(\s -> case s of { + ? => num (pot2as3 (pot1as2 (pot0as1 (s2s10 s)))) ; + ? + ? => num (pot2as3 (pot1as2 (s2s100 s))) ; + +-- m@(? + _) + "000" => num (pot3 (s2s1000 m)) ; +-- m@(? + _) + "00" + n@? => num (pot3plus (s2s1000 m) (s2s1000 n)) ; +-- m@(? + _) + "0" + n@(? + ?) => num (pot3plus (s2s1000 m) (s2s1000 n)) ; +-- m@(? + _) + n@(? + ? + ?) => num (pot3plus (s2s1000 m) (s2s1000 n)) ; +-- _ => num (pot2as3 (s2s1000 s)) + _ => Predef.error ("no numeral for string" ++ s) + }) where { s2d : Str -> Digit = \s -> case s of { @@ -1681,13 +1686,14 @@ oper d@#idigit + n@? => pot1plus (s2d d) (s2s10 n) ; _ => pot0as1 (s2s10 s) } ; - +{- s2s1000 : Str -> Sub1000 = \s -> case s of { d@? + "00" => pot2 (s2s10 d) ; d@? + "0" + n@? => pot2plus (s2s10 d) (s2s100 n) ; d@? + n@(? + ?) => pot2plus (s2s10 d) (s2s100 n) ; _ => pot1as2 (s2s100 s) } ; +-} } ; idigit : pattern Str = #("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9") ; digit : pattern Str = #("0" | #idigit) ; diff --git a/lib/src/finnish/NumeralFin.gf b/lib/src/finnish/NumeralFin.gf index f7f596769..cbd86437d 100644 --- a/lib/src/finnish/NumeralFin.gf +++ b/lib/src/finnish/NumeralFin.gf @@ -91,9 +91,9 @@ oper sada = init sadas in mkN - sadas (sada + "nnen") (sada + "nten" + a) (sada + "tt" + a) (sada + "nteen") - (sada + "nsin" + a) (sada + "nsiss" + a) (sada + "nsien") - (sada + "nsi" + a) (sada + "nsiin") ; + sadas (sada + "nnen") (sada + "tt" + a) (sada + "nten" + a) (sada + "nteen") + (sada + "nsien") (sada + "nsi" + a) (sada + "nsin" + a) + (sada + "nsiss" + a) (sada + "nsiin") ; param NumPlace = NumIndep | NumAttr ; diff --git a/lib/src/finnish/ParadigmsFin.gf b/lib/src/finnish/ParadigmsFin.gf index a2e49bb8e..b03c237de 100644 --- a/lib/src/finnish/ParadigmsFin.gf +++ b/lib/src/finnish/ParadigmsFin.gf @@ -94,7 +94,7 @@ oper mkN : (savi,savia : Str) -> N ; -- different pl.part mkN : (vesi,veden,vesiä : Str) -> N ; -- also different sg.gen mkN : (vesi,veden,vesiä,vettä : Str) -> N ; -- also different sg.part - mkN : (olo,n,na,a,oon,jen,ja,ina,issa,ihin : Str) -> N ; -- worst case, 10 forms + mkN : (olo,n,a,na,oon,jen,ja,ina,issa,ihin : Str) -> N ; -- worst case, 10 forms mkN : (pika : Str) -> (juna : N) -> N ; -- compound with invariable prefix mkN : (oma : N) -> (tunto : N) -> N ; -- compound with inflecting prefix } ;