summaryrefslogtreecommitdiff
path: root/src/GF/Infra/ReadFiles.hs
diff options
context:
space:
mode:
authoraarne <unknown>2004-04-01 09:51:32 +0000
committeraarne <unknown>2004-04-01 09:51:32 +0000
commitf53f35978f4cd6b0e4c5e9123b5e88f04f6f4452 (patch)
tree100fc2f36a0dccc24c030b5a82389dac70780902 /src/GF/Infra/ReadFiles.hs
parent3f9b4e7855cf4594708a9fbad194c89540d2cf1e (diff)
2beta2
Diffstat (limited to 'src/GF/Infra/ReadFiles.hs')
-rw-r--r--src/GF/Infra/ReadFiles.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/GF/Infra/ReadFiles.hs b/src/GF/Infra/ReadFiles.hs
index 4172ee32e..46091c6b5 100644
--- a/src/GF/Infra/ReadFiles.hs
+++ b/src/GF/Infra/ReadFiles.hs
@@ -6,7 +6,7 @@ module ReadFiles
--
getAllFiles,fixNewlines,ModName,getOptionsFromFile,
--
-gfcFile,gfFile,gfrFile,isGFC,resModName) where
+gfcFile,gfFile,gfrFile,isGFC,resModName,isOldFile) where
import Arch (selectLater, modifiedFiles, ModTime, getModTime,laterModTime)
@@ -251,6 +251,18 @@ getOptionsFromFile file = do
let ls = filter (isPrefixOf "--#") $ lines s
return $ fst $ getOptions "-" $ map (unwords . words . drop 3) ls
+-- check if old GF file
+isOldFile :: FilePath -> IO Bool
+isOldFile f = do
+ s <- readFileIf f
+ let s' = unComm s
+ return $ not (null s') && old (head (words s'))
+ where
+ old = flip elem $ words
+ "cat category data def flags fun include lin lincat lindef lintype oper param pattern printname rule"
+
+
+
-- old GF tolerated newlines in quotes. No more supported!
fixNewlines s = case s of
'"':cs -> '"':mk cs