summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-02-26 21:36:08 +0100
committerPéter Diviánszky <divipp@gmail.com>2016-02-26 21:36:08 +0100
commit92f557c8e2dd5f0af5d87520786b6ed28a333973 (patch)
tree5427be47382f5a5b6b5a743d6a3fd930d171d881 /src
parent2186ec1c92176a6b9f4382d61d5bb3e6c1fbea99 (diff)
show more error ranges
Diffstat (limited to 'src')
-rw-r--r--src/LambdaCube/Compiler/Infer.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/LambdaCube/Compiler/Infer.hs b/src/LambdaCube/Compiler/Infer.hs
index 48a3169b..743ae3ec 100644
--- a/src/LambdaCube/Compiler/Infer.hs
+++ b/src/LambdaCube/Compiler/Infer.hs
@@ -818,10 +818,10 @@ instance NFData ErrorMsg where
818 ERedefined a b c -> rnf (a, b, c) 818 ERedefined a b c -> rnf (a, b, c)
819 819
820errorRange_ = \case 820errorRange_ = \case
821 ErrorMsg s -> Nothing 821 ErrorMsg s -> []
822 ECantFind s si -> Just si 822 ECantFind s si -> [si]
823 ETypeError msg si -> Just si 823 ETypeError msg si -> [si]
824 ERedefined s si si' -> Just si 824 ERedefined s si si' -> [si, si']
825 825
826showError :: Map.Map FilePath String -> ErrorMsg -> String 826showError :: Map.Map FilePath String -> ErrorMsg -> String
827showError srcs = \case 827showError srcs = \case
@@ -1200,7 +1200,7 @@ instance Show Info where
1200 ITrace i s -> i ++ ": " ++ correctEscs s 1200 ITrace i s -> i ++ ": " ++ correctEscs s
1201 IError e -> "!" ++ show e 1201 IError e -> "!" ++ show e
1202 1202
1203errorRange is = listToMaybe [(sourceLine f, sourceColumn f, sourceLine t, sourceColumn t) | IError e <- is, Just (RangeSI (Range f t)) <- [errorRange_ e] ] 1203errorRange is = [r | IError e <- is, RangeSI r <- errorRange_ e ]
1204 1204
1205type Infos = [Info] 1205type Infos = [Info]
1206 1206