@@ -23,7 +23,7 @@ import Debug.Trace
2323import Paths_idris
2424
2525ibcVersion :: Word8
26−ibcVersion = 42
26+ibcVersion = 43
2727
2828data IBCFile = IBCFile { ver :: Word8,
2929 sourcefile :: FilePath,
@@ -50,7 +50,8 @@ data IBCFile = IBCFile { ver :: Word8,
5050 ibc_defs :: [(Name, Def)],
5151 ibc_docstrings :: [(Name, String)],
5252 ibc_transforms :: [(Term, Term)],
53− ibc_coercions :: [Name]
53+ ibc_coercions :: [Name],
54+ ibc_linenames :: [(FilePath, Int, Name, Int)]
5455 }
5556 deriving Show
5657{-!
@@ -58,7 +59,7 @@ deriving instance Binary IBCFile
5859!-}
5960
6061initIBC :: IBCFile
61−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
62+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
6263
6364loadIBC :: FilePath -> Idris ()
6465loadIBC 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 }
134135ibc i (IBCFlags n a) f = return f { ibc_flags = (n,a) : ibc_flags f }
135136ibc i (IBCTotal n a) f = return f { ibc_total = (n,a) : ibc_total f }
136137ibc 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 }
137140
138141process :: IBCFile -> FilePath -> Idris ()
139142process i fn
@@ -168,6 +171,7 @@ process i fn
168171 pDocs (ibc_docstrings i)
169172 pCoercions (ibc_coercions i)
170173 pTrans (ibc_transforms i)
174+ pLineNames (ibc_linenames i)
171175
172176timestampOlder :: FilePath -> FilePath -> IO ()
173177timestampOlder src ibc = do srct <- getModificationTime src
@@ -312,6 +316,9 @@ pCoercions ns = mapM_ (\ n -> addCoercion n) ns
312316pTrans :: [(Term, Term)] -> Idris ()
313317pTrans ts = mapM_ addTrans ts
314318
319+pLineNames :: [(FilePath, Int, Name, Int)] -> Idris ()
320+pLineNames ls = mapM_ (\ (f, i, n, w) -> addInternalName f i n w) ls
321+
315322----- Generated by 'derive'
316323
317324instance Binary SizeChange where
@@ -861,7 +868,7 @@ instance Binary Totality where
861868 _ -> error "Corrupted binary data for Totality"
862869
863870instance 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)
865872 = {-# SCC "putIBCFile" #-}
866873 do put x1
867874 put x2
@@ -889,6 +896,7 @@ instance Binary IBCFile where
889896 put x24
890897 put x25
891898 put x26
899+ put x27
892900 get
893901 = do x1 <- get
894902 if x1 == ibcVersion then
@@ -917,7 +925,8 @@ instance Binary IBCFile where
917925 x24 <- get
918926 x25 <- get
919927 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)
928+ x27 <- get
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)
921930 else return (initIBC { ver = x1 })
922931
923932instance Binary FnOpt where