From be6465a2ebb1aba43433cff29bf5bad6e2065e26 Mon Sep 17 00:00:00 2001 From: krasimir Date: Sun, 31 Jan 2010 15:54:25 +0000 Subject: refactor GF.Infra.Modules for better error messages --- src/compiler/GF/Infra/Ident.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/compiler/GF/Infra/Ident.hs') diff --git a/src/compiler/GF/Infra/Ident.hs b/src/compiler/GF/Infra/Ident.hs index efe6f9261..967945be9 100644 --- a/src/compiler/GF/Infra/Ident.hs +++ b/src/compiler/GF/Infra/Ident.hs @@ -13,7 +13,7 @@ ----------------------------------------------------------------------------- module GF.Infra.Ident (-- * Identifiers - Ident(..), ident2bs, showIdent, + Ident(..), ident2bs, showIdent, ppIdent, identC, identV, identA, identAV, identW, argIdent, varStr, varX, isWildIdent, varIndex, -- * refreshing identifiers @@ -23,7 +23,7 @@ module GF.Infra.Ident (-- * Identifiers import GF.Data.Operations import qualified Data.ByteString.Char8 as BS --- import Monad +import Text.PrettyPrint -- | the constructors labelled /INTERNAL/ are @@ -51,6 +51,9 @@ ident2bs i = case i of showIdent :: Ident -> String showIdent i = BS.unpack $! ident2bs i +ppIdent :: Ident -> Doc +ppIdent = text . showIdent + identC :: BS.ByteString -> Ident identV :: BS.ByteString -> Int -> Ident identA :: BS.ByteString -> Int -> Ident -- cgit v1.2.3