diff options
| author | krasimir <krasimir@chalmers.se> | 2010-03-22 21:15:29 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-03-22 21:15:29 +0000 |
| commit | bf74f50733840b0bcec81ac265c824ae2bc3f675 (patch) | |
| tree | 24cb47678cbc2e88de73a3a670930d68c5555593 /src/compiler/GF/Grammar/Binary.hs | |
| parent | 716a209f65a2dc10cdaec7e5b12af09267694b3a (diff) | |
store and propagate the exact source location for all judgements in the grammar. It may not be used accurately in the error messages yet
Diffstat (limited to 'src/compiler/GF/Grammar/Binary.hs')
| -rw-r--r-- | src/compiler/GF/Grammar/Binary.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/GF/Grammar/Binary.hs b/src/compiler/GF/Grammar/Binary.hs index 1febdcd46..ff34ae38a 100644 --- a/src/compiler/GF/Grammar/Binary.hs +++ b/src/compiler/GF/Grammar/Binary.hs @@ -31,9 +31,9 @@ instance Binary a => Binary (MGrammar a) where get = fmap MGrammar get
instance Binary a => Binary (ModInfo a) where
- put mi = do put (mtype mi,mstatus mi,flags mi,extend mi,mwith mi,opens mi,mexdeps mi,jments mi,positions mi)
- get = do (mtype,mstatus,flags,extend,mwith,opens,med,jments,positions) <- get
- return (ModInfo mtype mstatus flags extend mwith opens med jments positions)
+ put mi = do put (mtype mi,mstatus mi,flags mi,extend mi,mwith mi,opens mi,mexdeps mi,jments mi)
+ get = do (mtype,mstatus,flags,extend,mwith,opens,med,jments) <- get
+ return (ModInfo mtype mstatus flags extend mwith opens med jments)
instance Binary ModuleType where
put MTAbstract = putWord8 0
@@ -109,6 +109,10 @@ instance Binary Info where 8 -> get >>= \(x,y) -> return (AnyInd x y)
_ -> decodingError
+instance Binary a => Binary (L a) where
+ put (L x y) = put (x,y)
+ get = get >>= \(x,y) -> return (L x y)
+
instance Binary BindType where
put Explicit = putWord8 0
put Implicit = putWord8 1
@@ -258,6 +262,6 @@ instance Binary Label where decodeModHeader :: FilePath -> IO SourceModule
decodeModHeader fpath = do
(m,mtype,mstatus,flags,extend,mwith,opens,med) <- decodeFile fpath
- return (m,ModInfo mtype mstatus flags extend mwith opens med Map.empty Map.empty)
+ return (m,ModInfo mtype mstatus flags extend mwith opens med Map.empty)
decodingError = fail "This GFO file was compiled with different version of GF"
|
