mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-01 23:32:51 -06:00
clean up the GF.Grammar API
This commit is contained in:
@@ -33,7 +33,7 @@ module GF.Infra.Modules (
|
||||
IdentM(..),
|
||||
abstractOfConcrete, abstractModOfConcrete,
|
||||
lookupModule, lookupModuleType, lookupInfo,
|
||||
lookupPosition, showPosition, ppPosition,
|
||||
lookupPosition, ppPosition,
|
||||
isModAbs, isModRes, isModCnc, isModTrans,
|
||||
sameMType, isCompilableModule, isCompleteModule,
|
||||
allAbstracts, greatestAbstract, allResources,
|
||||
@@ -268,12 +268,6 @@ lookupInfo mo i = lookupTree show i (jments mo)
|
||||
lookupPosition :: (Show i, Ord i) => ModInfo i a -> i -> Err (String,(Int,Int))
|
||||
lookupPosition mo i = lookupTree show i (positions mo)
|
||||
|
||||
showPosition :: (Show i, Ord i) => ModInfo i a -> i -> String
|
||||
showPosition mo i = case lookupPosition mo i of
|
||||
Ok (f,(b,e)) | b == e -> "in" +++ f ++ ", line" +++ show b
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user