mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
Making cf2gf to work...
This commit is contained in:
@@ -55,10 +55,13 @@ batchCompileOld f = compileOld defOpts f
|
||||
|
||||
compileModule :: Options -> ShellState -> FilePath ->
|
||||
IOE (GFC.CanonGrammar, (SourceGrammar,[(FilePath,ModTime)]))
|
||||
compileModule opts st0 file | oElem showOld opts = do
|
||||
|
||||
compileModule opts st0 file | oElem showOld opts || fileSuffix file == "cf" = do
|
||||
let putp = putPointE opts
|
||||
let path = [] ----
|
||||
grammar1 <- putp ("- parsing old gf" +++ file) $ getOldGrammar opts file
|
||||
grammar1 <- if fileSuffix file == "cf"
|
||||
then putp ("- parsing cf" +++ file) $ getCFGrammar opts file
|
||||
else putp ("- parsing old gf" +++ file) $ getOldGrammar opts file
|
||||
let mods = modules grammar1
|
||||
let env = compileEnvShSt st0 []
|
||||
(_,sgr,cgr) <- foldM (comp putp path) env mods
|
||||
|
||||
@@ -88,7 +88,7 @@ getCFGrammar :: Options -> FilePath -> IOE SourceGrammar
|
||||
getCFGrammar opts file = do
|
||||
let mo = takeWhile (/='-') file
|
||||
s <- ioeIO $ readFileIf file
|
||||
cf <- ioeErr $ pCF mo file
|
||||
cf <- ioeErr $ pCF mo s
|
||||
defs <- return $ cf2grammar cf
|
||||
let g = A.OldGr A.NoIncl defs
|
||||
ioeErr $ transOldGrammar opts file g
|
||||
|
||||
Reference in New Issue
Block a user