@@ -23,7 +23,7 @@ import Debug.Trace
23import Paths_idris
23import Paths_idris
25ibcVersion :: Word8
25ibcVersion :: Word8
26−ibcVersion = 42
26+ibcVersion = 43
28data IBCFile = IBCFile { ver :: Word8,
28data IBCFile = IBCFile { ver :: Word8,
29 sourcefile :: FilePath,
29 sourcefile :: FilePath,
@@ -50,7 +50,8 @@ data IBCFile = IBCFile { ver :: Word8,
50 ibc_defs :: [(Name, Def)],
50 ibc_defs :: [(Name, Def)],
51 ibc_docstrings :: [(Name, String)],
51 ibc_docstrings :: [(Name, String)],
52 ibc_transforms :: [(Term, Term)],
52 ibc_transforms :: [(Term, Term)],
53− ibc_coercions :: [Name]
53+ ibc_coercions :: [Name],
54+ ibc_linenames :: [(FilePath, Int, Name, Int)]
55 deriving Show
56 deriving Show
@@ -58,7 +59,7 @@ deriving instance Binary IBCFile
60initIBC :: IBCFile
61initIBC :: IBCFile
61−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
62+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
63loadIBC :: FilePath -> Idris ()
64loadIBC :: FilePath -> Idris ()
64loadIBC fp = do iLOG $ "Loading ibc " ++ fp
65loadIBC fp = do iLOG $ "Loading ibc " ++ fp
@@ -134,6 +135,8 @@ ibc i (IBCAccess n a) f = return f { ibc_access = (n,a) : ibc_access f }
134ibc i (IBCFlags n a) f = return f { ibc_flags = (n,a) : ibc_flags f }
135ibc i (IBCFlags n a) f = return f { ibc_flags = (n,a) : ibc_flags f }
135ibc i (IBCTotal n a) f = return f { ibc_total = (n,a) : ibc_total f }
136ibc i (IBCTotal n a) f = return f { ibc_total = (n,a) : ibc_total f }
136ibc i (IBCTrans t) f = return f { ibc_transforms = t : ibc_transforms f }
137ibc i (IBCTrans t) f = return f { ibc_transforms = t : ibc_transforms f }
138+ibc i (IBCLineName fp l n w) f
139+ = return f { ibc_linenames = (fp,l,n, w) : ibc_linenames f }
138process :: IBCFile -> FilePath -> Idris ()
141process :: IBCFile -> FilePath -> Idris ()
139process i fn
142process i fn
@@ -168,6 +171,7 @@ process i fn
168 pDocs (ibc_docstrings i)
171 pDocs (ibc_docstrings i)
169 pCoercions (ibc_coercions i)
172 pCoercions (ibc_coercions i)
170 pTrans (ibc_transforms i)
173 pTrans (ibc_transforms i)
174+ pLineNames (ibc_linenames i)
172timestampOlder :: FilePath -> FilePath -> IO ()
176timestampOlder :: FilePath -> FilePath -> IO ()
173timestampOlder src ibc = do srct <- getModificationTime src
177timestampOlder src ibc = do srct <- getModificationTime src
@@ -312,6 +316,9 @@ pCoercions ns = mapM_ (\ n -> addCoercion n) ns
312pTrans :: [(Term, Term)] -> Idris ()
316pTrans :: [(Term, Term)] -> Idris ()
313pTrans ts = mapM_ addTrans ts
317pTrans ts = mapM_ addTrans ts
319+pLineNames :: [(FilePath, Int, Name, Int)] -> Idris ()
320+pLineNames ls = mapM_ (\ (f, i, n, w) -> addInternalName f i n w) ls
315----- Generated by 'derive'
322----- Generated by 'derive'
317instance Binary SizeChange where
324instance Binary SizeChange where
@@ -861,7 +868,7 @@ instance Binary Totality where
861 _ -> error "Corrupted binary data for Totality"
868 _ -> error "Corrupted binary data for Totality"
863instance Binary IBCFile where
870instance Binary IBCFile where
864− put x@(IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26)
871+ put x@(IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27)
865 = {-# SCC "putIBCFile" #-}
872 = {-# SCC "putIBCFile" #-}
866 do put x1
873 do put x1
@@ -889,6 +896,7 @@ instance Binary IBCFile where
893 = do x1 <- get
901 = do x1 <- get
894 if x1 == ibcVersion then
902 if x1 == ibcVersion then
@@ -917,7 +925,8 @@ instance Binary IBCFile where
917 x24 <- get
925 x24 <- get
918 x25 <- get
926 x25 <- get
919 x26 <- get
927 x26 <- get
920− return (IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26)
929+ return (IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27)
921 else return (initIBC { ver = x1 })
930 else return (initIBC { ver = x1 })
923instance Binary FnOpt where
932instance Binary FnOpt where