diff options
| author | krasimir <krasimir@chalmers.se> | 2009-09-14 12:16:02 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-09-14 12:16:02 +0000 |
| commit | 62ef772a2c996f2d7d17529eeee845be90586a78 (patch) | |
| tree | 3d415cb7c1a10a98172fa2c1192b9ac353f5935e /src/GF/Infra/Modules.hs | |
| parent | cc151c42790e02d60d6a0ab18c9c56da76f0ea51 (diff) | |
CheckGrammar is now using the printer in GF.Grammar.Printer. Fixed bug that was hiding the warnings
Diffstat (limited to 'src/GF/Infra/Modules.hs')
| -rw-r--r-- | src/GF/Infra/Modules.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/GF/Infra/Modules.hs b/src/GF/Infra/Modules.hs index 573c59ca5..0b951dd14 100644 --- a/src/GF/Infra/Modules.hs +++ b/src/GF/Infra/Modules.hs @@ -33,7 +33,7 @@ module GF.Infra.Modules ( IdentM(..), abstractOfConcrete, abstractModOfConcrete, lookupModule, lookupModuleType, lookupInfo, - lookupPosition, showPosition, + lookupPosition, showPosition, ppPosition, isModAbs, isModRes, isModCnc, isModTrans, sameMType, isCompilableModule, isCompleteModule, allAbstracts, greatestAbstract, allResources, @@ -45,7 +45,7 @@ import GF.Infra.Option import GF.Data.Operations import Data.List - +import Text.PrettyPrint -- AR 29/4/2003 @@ -274,6 +274,12 @@ showPosition mo i = case lookupPosition mo i of Ok (f,(b,e)) -> "in" +++ f ++ ", lines" +++ show b ++ "-" ++ show e _ -> "" +ppPosition :: (Show i, Ord i) => ModInfo i a -> i -> Doc +ppPosition mo i = case lookupPosition mo i of + Ok (f,(b,e)) | b == e -> text "in" <+> text f <> text ", line" <+> int b + | otherwise -> text "in" <+> text f <> text ", lines" <+> int b <> text "-" <> int e + _ -> empty + isModAbs :: ModInfo i a -> Bool isModAbs m = case mtype m of MTAbstract -> True |
