fix mkmissing and update missinglat

This commit is contained in:
Herbert Lange
2019-11-12 16:03:55 +01:00
parent f2eebc3a64
commit 6f35b9f67f
3 changed files with 34 additions and 96 deletions
+5 -4
View File
@@ -1,10 +1,11 @@
import PGF
import System.Environment
import Data.List
import Data.Maybe
main =
do
args <- getArgs -- first one should be pgf file and second one should be the file containing the errors/warnings about missing things
pgf <- PGF.readPGF (args !! 0) -- "tmp/Lang.pgf"
ms <- readFile (args !! 1) {- "tmp/MissingLat.tmp" -} >>= return . map (last . words) . lines
let ts = [PGF.showType [] t | m <- ms, Just t <- [PGF.functionType pgf (PGF.mkCId m)]]
putStrLn $ unlines ["oper " ++ f ++ " : " ++ t ++ " = notYet \"" ++ f ++ "\" ;" | (f,t) <- zip ms ts]
ms <- readFile (args !! 1) {- "tmp/MissingLat.tmp" -} >>= return . nub . sort . map (last . words) . lines
let ts = [maybe ("-- Error: No type found for " ++ m) (\t -> "oper " ++ m ++ " : " ++ PGF.showType [] t ++ " = notYet \"" ++ m ++ "\" ;") $ PGF.functionType pgf (PGF.mkCId m) | m <- ms ]
putStrLn $ unlines ts -- ["oper " ++ f ++ " : " ++ t ++ " = notYet \"" ++ f ++ "\" ;" | (f,t) <- zip ms ts]