mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-12 06:19:33 -06:00
Removed unused utf8-conversion code.
This commit is contained in:
@@ -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)
|
||||
-}
|
||||
Reference in New Issue
Block a user