From 22ba8d34ff00bde6aa83dc9bdcdd13de34799c08 Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 23 Jun 2015 12:58:14 +0000 Subject: 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". --- src/compiler/GF/CompileInParallel.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/compiler/GF/CompileInParallel.hs') 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