on master help sign in
Fix lidr compiler message position
3e98678PoroCYon
src/Idris/Unlit.hs+4−3
@@ -19,8 +19,9 @@ unlit f s = do let s' = map ulLine (lines s)
19data LineType = Prog | Blank | Comm
19data LineType = Prog | Blank | Comm
20
20
21ulLine :: String -> (LineType, String)
21ulLine :: String -> (LineType, String)
22−ulLine ('>':' ':xs) = (Prog, xs)
22+ulLine ('>':' ':xs) = (Prog, ' ':' ':xs) -- Replace with spaces, otherwise text position numbers will be bogus.
23−ulLine ('>':xs) = (Prog, xs)
23+ulLine ('>':xs) = (Prog, ' ' :xs) -- The parser can deal with this, because /every/ (code) line is prefixed
24+ -- with a '>'.
24ulLine xs | all isSpace xs = (Blank, "")
25ulLine xs | all isSpace xs = (Blank, "")
25-- make sure it's not a doc comment
26-- make sure it's not a doc comment
26 | otherwise = (Comm, '-':'-':' ':'>':xs)
27 | otherwise = (Comm, '-':'-':' ':'>':xs)
@@ -29,7 +30,7 @@ check :: FilePath -> Int -> [(LineType, String)] -> TC ()
29check f l (a:b:cs) = do chkAdj f l (fst a) (fst b)
30check f l (a:b:cs) = do chkAdj f l (fst a) (fst b)
30 check f (l+1) (b:cs)
31 check f (l+1) (b:cs)
31check f l [x] = return ()
32check f l [x] = return ()
32−check f l [] = return ()
33+check f l [ ] = return ()
33
34
34-- Issue #1593 on the issue checker.
35-- Issue #1593 on the issue checker.
35--
36--