summaryrefslogtreecommitdiff
path: root/src/compiler/GF/CompileInParallel.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2015-06-23 12:58:14 +0000
committerhallgren <hallgren@chalmers.se>2015-06-23 12:58:14 +0000
commit22ba8d34ff00bde6aa83dc9bdcdd13de34799c08 (patch)
treeab5299500cccec4d7fe3ea56852327e4c8e059a3 /src/compiler/GF/CompileInParallel.hs
parent984c09923ce5de629f111584f741b44c5e5eddd6 (diff)
Bump version of .gfo and .pgf files, improve error messages on version mismatch
Becacuse of the new special tokens added to the Symbol type, .gfo and .pgf files produced with the current version of GF can not always be used with older versions of GF and the PGF run-time system. The PGF version number was increased from (2,0) to (2,1). GF can still read version (2,0) and (1,0), so old PGF files continue to work. The GFO version was increased from "GF03" to "GF04".
Diffstat (limited to 'src/compiler/GF/CompileInParallel.hs')
-rw-r--r--src/compiler/GF/CompileInParallel.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/GF/CompileInParallel.hs b/src/compiler/GF/CompileInParallel.hs
index 4f5c0f76b..07c29febd 100644
--- a/src/compiler/GF/CompileInParallel.hs
+++ b/src/compiler/GF/CompileInParallel.hs
@@ -9,7 +9,7 @@ import qualified GF.System.Directory as D
import GF.System.Catch(catch,try)
import Data.List(nub,isPrefixOf,intercalate,partition)
import qualified Data.Map as M
-import GF.Compile.ReadFiles(getOptionsFromFile,findFile,gfImports,gfoImports)
+import GF.Compile.ReadFiles(getOptionsFromFile,findFile,gfImports,gfoImports,VersionTagged(..))
import GF.CompileOne(reuseGFO,useTheSource)
import GF.Infra.Option
import GF.Infra.UseIO
@@ -177,8 +177,10 @@ getPathFromFile lib_dir cmdline_opts file =
getImports opts file =
if isGFO file then gfoImports' file else gfImports opts file
where
- gfoImports' file = maybe bad return =<< gfoImports file
- where bad = raise $ file++": bad .gfo file"
+ gfoImports' file = check =<< gfoImports file
+ where
+ check (Tagged imps) = return imps
+ check WrongVersion = raise $ file++": .gfo file version mismatch"
relativeTo lib_dir cwd path =
if length librel<length cwdrel then librel else cwdrel