diff options
Diffstat (limited to 'src/compiler/GF/Compile/GetGrammar.hs')
| -rw-r--r-- | src/compiler/GF/Compile/GetGrammar.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/GF/Compile/GetGrammar.hs b/src/compiler/GF/Compile/GetGrammar.hs index c7fea11b0..339f28578 100644 --- a/src/compiler/GF/Compile/GetGrammar.hs +++ b/src/compiler/GF/Compile/GetGrammar.hs @@ -41,9 +41,12 @@ getSourceModule opts file0 = ioe $ let location = file++":"++show l++":"++show c return (Bad (location++": "++msg)) Right mo -> do removeTemp tmp - return (Ok (addOptionsToModule opts mo)) + return (Ok (addOptionsToModule opts (setSrcPath file0 mo))) `catch` (return . Bad . show) +setSrcPath :: FilePath -> SourceModule -> SourceModule +setSrcPath fpath = mapSourceModule (\m -> m{msrc=fpath}) + addOptionsToModule :: Options -> SourceModule -> SourceModule addOptionsToModule opts = mapSourceModule (\m -> m { flags = flags m `addOptions` opts }) |
