From 5a7d6e542d7fc0c01bec9163e4be732ac1c6d217 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 14 Nov 2003 12:36:23 +0000 Subject: New unicodings. New unicodings. Module with works. Better compilation of old GF. --- src/GF/Source/SourceToGrammar.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/GF/Source') diff --git a/src/GF/Source/SourceToGrammar.hs b/src/GF/Source/SourceToGrammar.hs index 53681104c..17e1819ca 100644 --- a/src/GF/Source/SourceToGrammar.hs +++ b/src/GF/Source/SourceToGrammar.hs @@ -12,6 +12,7 @@ import AbsGF import PrintGF import RemoveLiT --- for bw compat import Operations +import Option import Monad import Char @@ -482,8 +483,8 @@ transDDecl x = case x of -- to deal with the old format, sort judgements in three modules, forming -- their names from a given string, e.g. file name or overriding user-given string -transOldGrammar :: OldGrammar -> String -> Err G.SourceGrammar -transOldGrammar x name = case x of +transOldGrammar :: Options -> FilePath -> OldGrammar -> Err G.SourceGrammar +transOldGrammar opts name0 x = case x of OldGr includes topdefs -> do --- includes must be collected separately let moddefs = sortTopDefs topdefs g1 <- transGrammar $ Gr moddefs @@ -515,9 +516,10 @@ transOldGrammar x name = case x of ne = NoExt q = CMCompl - absName = identC topic - resName = identC ("Res" ++ lang) - cncName = identC lang + name = maybe name0 (++ ".gf") $ getOptVal opts useName + absName = identC $ maybe topic id $ getOptVal opts useAbsName + resName = identC $ maybe ("Res" ++ lang) id $ getOptVal opts useResName + cncName = identC $ maybe lang id $ getOptVal opts useCncName (beg,rest) = span (/='.') name (topic,lang) = case rest of -- to avoid overwriting old files -- cgit v1.2.3