on master help sign in
on error, report the column, as well as the line number in the ideslave mode.
cbe9965Hannes Mehnert
src/Idris/AbsSyntax.hs+1−1
@@ -390,7 +390,7 @@ ihWarn :: Handle -> FC -> String -> Idris ()
390ihWarn h fc err = do i <- getIState
390ihWarn h fc err = do i <- getIState
391 case idris_outputmode i of
391 case idris_outputmode i of
392 RawOutput -> runIO $ hPutStrLn h (show fc ++ ":" ++ err)
392 RawOutput -> runIO $ hPutStrLn h (show fc ++ ":" ++ err)
393− IdeSlave n -> runIO $ hPutStrLn h $ convSExp "warning" (fc_fname fc, fc_line fc, err) n
393+ IdeSlave n -> runIO $ hPutStrLn h $ convSExp "warning" (fc_fname fc, fc_line fc, fc_column fc, err) n
394
394
395setLogLevel :: Int -> Idris ()
395setLogLevel :: Int -> Idris ()
396setLogLevel l = do i <- getIState
396setLogLevel l = do i <- getIState
src/Idris/IdeSlave.hs+3
@@ -66,6 +66,9 @@ instance (SExpable a, SExpable b) => SExpable (a, b) where
66instance (SExpable a, SExpable b, SExpable c) => SExpable (a, b, c) where
66instance (SExpable a, SExpable b, SExpable c) => SExpable (a, b, c) where
67 toSExp (l, m, n) = SexpList [toSExp l, toSExp m, toSExp n]
67 toSExp (l, m, n) = SexpList [toSExp l, toSExp m, toSExp n]
68
68
69+instance (SExpable a, SExpable b, SExpable c, SExpable d) => SExpable (a, b, c, d) where
70+ toSExp (l, m, n, o) = SexpList [toSExp l, toSExp m, toSExp n, toSExp o]
71+
69escape :: String -> String
72escape :: String -> String
70escape = concatMap escapeChar
73escape = concatMap escapeChar
71 where
74 where
src/Idris/Parser.hs+2−1
@@ -945,7 +945,8 @@ findFC :: Doc -> (FC, String)
945findFC x = let s = show (plain x) in
945findFC x = let s = show (plain x) in
946 case span (/= ':') s of
946 case span (/= ':') s of
947 (failname, ':':rest) -> case span isDigit rest of
947 (failname, ':':rest) -> case span isDigit rest of
948+ (line, ':':rest') -> case span isDigit rest' of
948− (line, ':':rest') -> (FC failname (read line) 0, drop 2 (dropWhile (/= ':') rest'))
949+ (col, ':':msg) -> (FC failname (read line) (read col), msg)
949
950
950-- | A program is a list of declarations, possibly with associated
951-- | A program is a list of declarations, possibly with associated
951-- documentation strings.
952-- documentation strings.