From a1aa9c01e6065874e5a67f908334cdbc3bf53ea1 Mon Sep 17 00:00:00 2001 From: bringert Date: Tue, 8 Mar 2005 14:51:17 +0000 Subject: Removed unused utf8-conversion code. --- src/GF/API.hs | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/GF/API.hs') diff --git a/src/GF/API.hs b/src/GF/API.hs index f8006032d..8e1526ca6 100644 --- a/src/GF/API.hs +++ b/src/GF/API.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/03/08 15:49:24 $ +-- > CVS $Date: 2005/03/08 15:51:17 $ -- > CVS $Author: bringert $ --- > CVS $Revision: 1.29 $ +-- > CVS $Revision: 1.30 $ -- -- Application Programmer's Interface to GF; also used by Shell. AR 10/11/2001 ----------------------------------------------------------------------------- @@ -303,16 +303,13 @@ optPrintMultiGrammar opts = encodeId . pmg . encode pmg = customOrDefault opts grammarPrinter customMultiGrammarPrinter -- if -utf8 was given, convert from language specific codings encode = if oElem useUTF8 opts then mapModules moduleToUTF8 else id - -- if -utf8id was given, convert identifiers to UTF8 --- encodeId = if oElem useUTF8id opts then grammarIdentsToUTF8 else id + -- if -utf8id was given, convert non-literals to UTF8 encodeId = if oElem useUTF8id opts then nonLiteralsToUTF8 else id moduleToUTF8 m = m{ jments = mapTree (onSnd (mapInfoTerms code)) (jments m), flags = setFlag "coding" "utf8" (flags m) } where code = onTokens (anyCodingToUTF8 (moduleOpts m)) moduleOpts = Opts . okError . mapM CG.redFlag . flags --- grammarIdentsToUTF8 mgr --- = MGrammar [ (identToUTF8 i, mapIdents identToUTF8 mi) | (i,mi) <- modules mgr] optPrintSyntax :: Options -> GF.Grammar -> String optPrintSyntax opts = customOrDefault opts grammarPrinter customSyntaxPrinter @@ -387,14 +384,3 @@ nonLiteralsToUTF8 ('"':cs) = '"' : l ++ nonLiteralsToUTF8 rs takeStringLit (c:cs) = (c:xs,ys) where (xs,ys) = takeStringLit cs nonLiteralsToUTF8 (c:cs) = encodeUTF8 [c] ++ nonLiteralsToUTF8 cs - -{- --- | Convert an identifier in unicode to UTF8 encoding -identToUTF8 :: I.Ident -> I.Ident -identToUTF8 i = case i of - I.IC s -> I.IC (encodeUTF8 s) - I.IW -> I.IW - I.IV (i,s) -> I.IV (i, encodeUTF8 s) - I.IA (s,i) -> I.IA (encodeUTF8 s, i) - I.IAV (s,i1,i2) -> I.IAV (encodeUTF8 s, i2, i2) --} \ No newline at end of file -- cgit v1.2.3