definition: |
staticProgAnalysis :: Options -> String -> String -> CurryProg -> IO ([String],[(QName,String)]) staticProgAnalysis opts modname progtxt prog = do putStrIfDetails opts "Checking source code for static errors...\n" fcyprog <- readFlatCurry modname useerrs <- if optSource opts then checkBlacklistUse prog else return [] seterrs <- if optSource opts then checkSetUse fcyprog else return [] let defruleerrs = if optSource opts then checkDefaultRules prog else [] untypedprog <- readUntypedCurry modname let detuseerrs = if optSource opts then checkDetUse untypedprog else [] contracterrs = checkContractUsage modname (map (\fd -> (snd (FCG.funcName fd), FCG.funcType fd)) (FCG.progFuncs fcyprog)) staticerrs = concat [seterrs,useerrs,defruleerrs,detuseerrs,contracterrs] missingCPP = if (containsDefaultRules prog || containsDetOperations untypedprog) && not (containsPPOptionLine progtxt) then ["'" ++ modname ++ "' uses default rules or det. operations but not the preprocessor!", "Hint: insert line: {-# OPTIONS_FRONTEND -F --pgmF=currypp #-}"] else [] return (missingCPP,staticerrs) |
demand: |
no demanded arguments |
deterministic: |
deterministic operation |
documentation: |
-- Analyse a Curry module for static errors: |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
name: |
staticProgAnalysis |
precedence: |
no precedence defined |
result-values: |
_ |
signature: |
CC.Options.Options -> String -> String -> AbstractCurry.Types.CurryProg -> Prelude.IO ([String], [((String, String), String)]) |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
possibly non-reducible on same data term |