on master help sign in
Don't include '=' for RHS span
commitf743272eacec6e44d9994fd26132237ea2824f89 authorJason Felice <jason.m.felice@gmail.com> dateWed 6 Dec 2017, 15:53 (9 years ago) parentbab82b5
20 files changed+94−93
src/Idris/Parser.hs+15−14 test/basic009/expected+2−2 test/basic018/expected+2−2 test/directives001/expected+8−8 test/error003/expected+2−2 test/layout001/expected+2−2 test/meta002/expected+4−4 test/proof007/expected+2−2 test/proof011/expected+4−4 test/quasiquote003/expected+2−2 test/quasiquote004/expected+2−2 test/quasiquote006/expected+6−6 test/regression002/expected+8−8 test/sourceLocation001/expected+2−2 test/totality009/expected+4−4 test/totality014/expected+1−1 test/tutorial006/expected+2−2 test/unique004/expected+18−18 test/universes001/expected+4−4 test/universes002/expected+4−4
src/Idris/Parser.hs+15−14
@@ -1054,15 +1054,15 @@ RHS ::= '=' Expr
10541054RHSName ::= '{' FnName '}';
10551055@
10561056-}
1057−rhs :: SyntaxInfo -> Name -> IdrisParser PTerm
1057+rhs :: SyntaxInfo -> Name -> IdrisParser (PTerm, FC)
10581058rhs syn n = do lchar '='
10591059 indentGt
1060− expr syn
1060+ withExtent $ expr syn
10611061 <|> do symbol "?=";
10621062 (name, fc) <- withExtent $ P.option n' (symbol "{" *> fnName <* symbol "}")
10631063 r <- expr syn
1064− return (addLet fc name r)
1065− <|> impossible
1064+ return (addLet fc name r, fc)
1065+ <|> withExtent impossible
10661066 <?> "function right hand side"
10671067 where mkN :: Name -> Name
10681068 mkN (UN x) = if (tnull x || not (isAlpha (thead x)))
@@ -1104,33 +1104,34 @@ WhereOrTerminator ::= WhereBlock | Terminator;
11041104clause :: SyntaxInfo -> IdrisParser PClause
11051105clause syn
11061106 -- unnamed with or function clause (inside a with)
1107− = appExtent (do
1108− wargs <- P.try (do pushIndent; some (wExpr syn))
1107+ = do wargs <- P.try (do pushIndent; some (wExpr syn))
11091108 ist <- get
11101109 n <- case lastParse ist of
11111110 Just t -> return t
11121111 Nothing -> fail "Invalid clause"
1113− (do r <- rhs syn n
1112+ (do (r, fc) <- rhs syn n
11141113 let wsyn = syn { syn_namespace = [], syn_toplevel = False }
11151114 (wheres, nmap) <- whereBlock n wsyn <* popIndent
11161115 <|> ([], []) <$ terminator
1117− return $ \fc -> PClauseR fc wargs r wheres) <|> (do
1116+ return $ PClauseR fc wargs r wheres) <|> (do
11181117 popIndent
1119− keyword "with"
1120− wval <- simpleExpr syn
1121− pn <- optProof
1118+ ((wval, pn), fc) <- withExtent $ do
1119+ keyword "with"
1120+ wval <- bracketed syn
1121+ pn <- optProof
1122+ return (wval, pn)
11221123 openBlock
11231124 ds <- some $ fnDecl syn
11241125 let withs = concat ds
11251126 closeBlock
1126− return $ \fc -> PWithR fc wargs wval pn withs))
1127+ return $ PWithR fc wargs wval pn withs)
11271128 -- <==
11281129 <|> do ty <- P.try (do pushIndent
11291130 ty <- simpleExpr syn
11301131 symbol "<=="
11311132 return ty)
11321133 (n, fc) <- withExtent (expandNS syn <$> fnName)
1133− r <- rhs syn n
1134+ (r, _) <- rhs syn n
11341135 let wsyn = syn { syn_namespace = [] }
11351136 (wheres, nmap) <- whereBlock n wsyn <* popIndent
11361137 <|> ([], []) <$ terminator
@@ -1145,7 +1146,7 @@ clause syn
11451146 <|> do pushIndent
11461147 (n, nfc, capp, wargs) <- lhs
11471148 modify $ \ist -> ist { lastParse = Just n }
1148− (do (rs, fc) <- withExtent (rhs syn n)
1149+ (do (rs, fc) <- rhs syn n
11491150 let wsyn = syn { syn_namespace = [] }
11501151 (wheres, nmap) <- whereBlock n wsyn <* popIndent
11511152 <|> ([], []) <$ terminator
test/basic009/expected+2−2
@@ -6,10 +6,10 @@ Faulty.idr:6:9-11:
66num is bound as an implicit
77 Did you mean to refer to A.num?
88
9−Faulty.idr:7:7-12:
9+Faulty.idr:7:9-12:
1010 |
11117 | fault = Refl
12− | ~~~~~~
12+ | ~~~~
1313When checking right hand side of fault with expected type
1414 num = 0
1515
test/basic018/expected+2−2
@@ -12,10 +12,10 @@ basic018.idr:12:8-12:
1212thing is bound as an implicit
1313 Did you mean to refer to Main.thing?
1414
15−basic018.idr:13:6-11:
15+basic018.idr:13:8-11:
1616 |
171713 | test = Refl
18− | ~~~~~~
18+ | ~~~~
1919When checking right hand side of test with expected type
2020 thing = S 41
2121
test/directives001/expected+8−8
@@ -12,31 +12,31 @@ directives001.idr:14:7:
1212Use of deprecated name directives001.Foo
1313To be replaced with `Bar`.
1414
15−directives001.idr:15:7-13:
15+directives001.idr:15:9-13:
1616 |
171715 | mkFoo = MkFoo
18− | ~~~~~~~
18+ | ~~~~~
1919Use of deprecated name directives001.Foo
2020To be replaced with `Bar`.
2121
22−directives001.idr:15:7-13:
22+directives001.idr:15:9-13:
2323 |
242415 | mkFoo = MkFoo
25− | ~~~~~~~
25+ | ~~~~~
2626Use of deprecated name directives001.Foo
2727To be replaced with `Bar`.
2828
29−directives001.idr:26:8-28:28:
29+directives001.idr:26:10-28:28:
3030 |
313126 | main = do
32− | ~~~~ ...
32+ | ~~ ...
3333Use of a fragile construct directives001.mkBar
3434How `Bar`s are to be created is still being discussed, `mkBar` is subject to change.
3535
36−directives001.idr:26:8-28:28:
36+directives001.idr:26:10-28:28:
3737 |
383826 | main = do
39− | ~~~~ ...
39+ | ~~ ...
4040Use of a fragile construct directives001.mkBar
4141How `Bar`s are to be created is still being discussed, `mkBar` is subject to change.
4242
test/error003/expected+2−2
@@ -1,7 +1,7 @@
1−ErrorReflection.idr:68:5-20:
1+ErrorReflection.idr:68:7-20:
22 |
3368 | bad = Lam (Var Here)
4− | ~~~~~~~~~~~~~~~~
4+ | ~~~~~~~~~~~~~~
55When checking right hand side of bad with expected type
66 Tm [] TUnit
77
test/layout001/expected+2−2
@@ -58,10 +58,10 @@ Wrong indention: should be greater than context indentation
5858 | ^
5959Wrong indention: should be greater than context indentation
6060
61−mplus1.idr:13:31-17:49:
61+mplus1.idr:13:34-17:49:
6262 |
636313 | term = do f <- factor
64− | ~~~~~~~~~~~~~~~~~ ...
64+ | ~~~~~~~~~~~~~~ ...
6565When checking right hand side of term with expected type
6666 Maybe Int
6767
test/meta002/expected+4−4
@@ -5,19 +5,19 @@ DataDef.idr:74:1-8:
55While running an elaboration script, the following error occurred:
66Prelude.Either.Either is already defined as a datatype.
77
8−Tacs.idr:299:15-300:78:
8+Tacs.idr:299:17-300:78:
99 |
1010299 | testElab3 = %runElab (elaborateSTLC (App (Lam "x" (App (Var 0) (Var 0)))
11− | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
11+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
1212When checking right hand side of testElab3 with expected type
1313 DPair Ty (Tm [])
1414
1515Unifying ty and ARR ty t would lead to infinite value
1616
17−AgdaStyleReflection.idr:315:5-20:
17+AgdaStyleReflection.idr:315:7-20:
1818 |
1919315 | baz = tactic trivial
20− | ~~~~~~~~~~~~~~~~
20+ | ~~~~~~~~~~~~~~
2121When checking right hand side of baz with expected type
2222 (Nat, Void)
2323
test/proof007/expected+2−2
@@ -1,7 +1,7 @@
1−DefaultArgUnknownName.idr:9:6-23:
1+DefaultArgUnknownName.idr:9:8-23:
22 |
339 | test = funWithBadDefArg
4− | ~~~~~~~~~~~~~~~~~~
4+ | ~~~~~~~~~~~~~~~~
55When checking right hand side of test with expected type
66 ()
77
test/proof011/expected+4−4
@@ -1,7 +1,7 @@
1−proof011.idr:20:5-21:18:
1+proof011.idr:20:7-21:18:
22 |
3320 | = rewrite vassoc xs ys xs using vreplace in
4− | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
4+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
55When checking right hand side of vassoc' with expected type
66 (x :: xs) ++ ys ++ zs = ((x :: xs) ++ ys) ++ zs
77
@@ -12,10 +12,10 @@ rewriting xs ++ ys ++ xs to (xs ++ ys) ++ xs did not change type x ::
1212 (xs ++ ys) ++
1313 zs
1414
15−proof011a.idr:14:5-37:
15+proof011a.idr:14:7-37:
1616 |
171714 | = rewrite vassoc xs ys xs in Refl
18− | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1919When checking right hand side of vassoc' with expected type
2020 (x :: xs) ++ ys ++ zs = ((x :: xs) ++ ys) ++ zs
2121
test/quasiquote003/expected+2−2
@@ -1,7 +1,7 @@
1−NoInfer.idr:11:5-11:
1+NoInfer.idr:11:7-11:
22 |
3311 | zzz = `(FZ)
4− | ~~~~~~~
4+ | ~~~~~
55When checking right hand side of zzz with expected type
66 TT
77
test/quasiquote004/expected+2−2
@@ -16,10 +16,10 @@ Quasiquote004.idr:50:27-31:
1616 | ~~~~~
1717This style of tactic proof is deprecated. See %runElab for the replacement.
1818
19−Quasiquote004.idr:50:25-51:18:
19+Quasiquote004.idr:50:27-51:18:
2020 |
212150 | Quasiquote004.getMeNat' = proof
22− | ~~~~~~~ ...
22+ | ~~~~~ ...
2323When checking right hand side of Quasiquote004.getMeNat' with expected type
2424 String
2525
test/quasiquote006/expected+6−6
@@ -1,26 +1,26 @@
1−quasiquote006.idr:9:3-10:
1+quasiquote006.idr:9:5-10:
22 |
339 | b = `{Nil}
4− | ~~~~~~~~
4+ | ~~~~~~
55When checking right hand side of b with expected type
66 TTName
77
88Can't disambiguate name: ForeignEnv.Nil,
99 Prelude.List.Nil
1010
11−quasiquote006.idr:12:3-17:
11+quasiquote006.idr:12:5-17:
1212 |
131312 | c = `{alsdkjflkj}
14− | ~~~~~~~~~~~~~~~
14+ | ~~~~~~~~~~~~~
1515When checking right hand side of c with expected type
1616 TTName
1717
1818No such variable alsdkjflkj
1919
20−quasiquote006.idr:15:3-11:
20+quasiquote006.idr:15:5-11:
2121 |
222215 | d = `{(::)}
23− | ~~~~~~~~~
23+ | ~~~~~~~
2424When checking right hand side of d with expected type
2525 TTName
2626
test/regression002/expected+8−8
@@ -92,10 +92,10 @@ reg018d.idr:8:1-39:
9292 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9393Main.pull is not total as there are missing cases
9494
95−reg023.idr:7:5-7:
95+reg023.idr:7:7:
9696 |
97977 | bad = Z
98− | ~~~
98+ | ^
9999When checking right hand side of bad with expected type
100100 f Nat
101101
@@ -136,10 +136,10 @@ reg034.idr:9:1-14:
136136When checking left hand side of foo:
137137Can't match on foo f x x Refl
138138
139−reg035b.idr:8:12-38:
139+reg035b.idr:8:14-38:
140140 |
1411418 | fins Z = ([] ** (finZEmpty {a=_}))
142− | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
142+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
143143No such variable __pi_arg
144144
145145reg044.idr:4:6-10:
@@ -148,10 +148,10 @@ reg044.idr:4:6-10:
148148 | ~~~~~
149149This style of tactic proof is deprecated. See %runElab for the replacement.
150150
151−reg044.idr:4:4-6:13:
151+reg044.idr:4:6-6:13:
152152 |
1531534 | pf = proof
154− | ~~~~~~~ ...
154+ | ~~~~~ ...
155155When checking right hand side of Main.pf with expected type
156156 (b : Nat) -> (a : Nat) -> (S a = S b) -> a = b
157157
@@ -173,10 +173,10 @@ reg049.idr:2:11-14:
173173When checking constructor Main.Bogus:
174174Void is not Main.Foo
175175
176−reg049.idr:5:6-12:
176+reg049.idr:5:8-12:
177177 |
1781785 | uhOh = Bogus
179− | ~~~~~~~
179+ | ~~~~~
180180When checking right hand side of uhOh with expected type
181181 Void
182182
test/sourceLocation001/expected+2−2
@@ -25,9 +25,9 @@ This style of tactic proof is deprecated. See %runElab for the replacement.
2525Testing using definition
2626FileLoc "SourceLoc.idr" (17, 11) (17, 16)
2727Testing using inline tactics
28−FileLoc "SourceLoc.idr" (21, 17) (21, 38)
28+FileLoc "SourceLoc.idr" (21, 19) (21, 38)
2929Testing using metavariable with later definition
30−FileLoc "SourceLoc.idr" (99, 16) (100, 16)
30+FileLoc "SourceLoc.idr" (99, 18) (100, 16)
3131-----------------------
3232Success!
3333Error at FileLoc "SourceLoc.idr" (73, 23) (73, 25)
test/totality009/expected+4−4
@@ -22,10 +22,10 @@ TestLambdaPossible.idr:12:1-13:40:
2222 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
2323Warning - TestLambdaPossible.wrongPossible' is possibly not total due to: TestLambdaPossible.case block in wrongPossible' at TestLambdaPossible.idr:12:25
2424
25−TestLambdaPossible.idr:9:15-35:
25+TestLambdaPossible.idr:9:17-35:
2626 |
27279 | wrongPossible = (\Flase impossible)
28− | ~~~~~~~~~~~~~~~~~~~~~
28+ | ~~~~~~~~~~~~~~~~~~~
2929Warning - TestLambdaPossible.case block in wrongPossible at TestLambdaPossible.idr:9:25-34 is not total as there are missing cases
3030
3131TestLambdaPossible.idr:9:1-35:
@@ -34,10 +34,10 @@ TestLambdaPossible.idr:9:1-35:
3434 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3535Warning - TestLambdaPossible.wrongPossible is possibly not total due to: TestLambdaPossible.case block in wrongPossible at TestLambdaPossible.idr:9:25-34
3636
37−TestLambdaPossible.idr:12:18-13:40:
37+TestLambdaPossible.idr:12:20-13:40:
3838 |
393912 | wrongPossible' x = case x of
40− | ~~~~~~~~~~~ ...
40+ | ~~~~~~~~~ ...
4141Warning - TestLambdaPossible.case block in wrongPossible' at TestLambdaPossible.idr:12:25 is not total as there are missing cases
4242
4343TestLambdaPossible.idr:12:1-13:40:
test/totality014/expected+1−1
@@ -9,5 +9,5 @@ Universe inconsistency.
99 Involved constraints:
1010 ConstraintFC {uconstraint = ./totality014.idr.w < ./totality014.idr.u, ufc = totality014.idr:1:6-9}
1111 ConstraintFC {uconstraint = ./totality014.idr.w < ./totality014.idr.u, ufc = totality014.idr:1:6-9}
12− ConstraintFC {uconstraint = ./totality014.idr.u <= ./totality014.idr.w, ufc = totality014.idr:6:27-29}
12+ ConstraintFC {uconstraint = ./totality014.idr.u <= ./totality014.idr.w, ufc = totality014.idr:6:29}
1313
test/tutorial006/expected+2−2
@@ -17,10 +17,10 @@ When checking argument xs to constructor Data.Vect.:::
1717 and
1818 plus len m
1919
20−tutorial006b.idr:10:37-50:
20+tutorial006b.idr:10:39-50:
2121 |
222210 | parity (S (S (j + j))) | Even = Even {n=S j}
23− | ~~~~~~~~~~~~~~
23+ | ~~~~~~~~~~~~
2424When checking right hand side of with block in Main.parity with expected type
2525 Parity (S (S (j + j)))
2626
test/unique004/expected+18−18
@@ -1,46 +1,46 @@
1−unique001a.idr:35:14-43:50:
1+unique001a.idr:35:16-43:50:
22 |
3335 | showStuff xs = do
4− | ~~~~ ...
4+ | ~~ ...
55Type mismatch between
66 Int -> String
77and
88 UniqueType (Int -> String)
99
10−unique001a.idr:46:15-54:28:
10+unique001a.idr:46:17-54:28:
1111 |
121246 | showStuff' xs = do
13− | ~~~~ ...
13+ | ~~ ...
1414Type mismatch between
1515 Int -> String
1616and
1717 UniqueType (Int -> String)
1818
19−unique001a.idr:57:15-62:33:
19+unique001a.idr:57:17-62:33:
2020 |
212157 | showThings xs = do
22− | ~~~~ ...
22+ | ~~ ...
2323Type mismatch between
2424 UniqueType (Int -> String)
2525and
2626 Int -> String
2727
28−unique001b.idr:18:17-42:
28+unique001b.idr:18:19-42:
2929 |
303018 | showU (x :: xs) = show x ++ "," ++ free xs
31− | ~~~~~~~~~~~~~~~~~~~~~~~~~~
31+ | ~~~~~~~~~~~~~~~~~~~~~~~~
3232Borrowed name xs must not be used on RHS
3333
34−unique001c.idr:47:12-62:
34+unique001c.idr:47:14-62:
3535 |
363647 | ndup {a} x = (\f : Int -> a => MkUPair (f 0) (f 1)) (uconst x)
37− | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3838Unique name f is used more than once
3939
40−unique001d.idr:4:16-18:
40+unique001d.idr:4:18:
4141 |
42424 | steal (Read x) = x
43− | ~~~
43+ | ^
4444Borrowed name x must not be used on RHS
4545
4646unique001e.idr:4:12-40:
@@ -49,25 +49,25 @@ unique001e.idr:4:12-40:
4949 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5050Constructor Main.Nil has a UniqueType, but the data type does not
5151
52−unique002.idr:17:8-20:19:
52+unique002.idr:17:10-20:19:
5353 |
545417 | foo xs = do -- let f = \x : Int => showU xs
55− | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
55+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
5656Unique name xs is used more than once
5757
58−unique002a.idr:17:8-20:19:
58+unique002a.idr:17:10-20:19:
5959 |
606017 | foo xs = do let f = \x : Int => showU xs
61− | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
61+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
6262Type mismatch between
6363 Int -> String
6464and
6565 UniqueType (Int -> String)
6666
67−unique003.idr:20:8-24:19:
67+unique003.idr:20:10-24:19:
6868 |
696920 | foo xs = do let f = \x : Int => showU xs -- can't build this in unique context
70− | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
70+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
7171Type mismatch between
7272 Int -> String
7373and
test/universes001/expected+4−4
@@ -1,14 +1,14 @@
1−universes001.idr:7:5-21:
1+universes001.idr:7:7-21:
22 |
337 | foo = Const (Const 0)
4− | ~~~~~~~~~~~~~~~~~
4+ | ~~~~~~~~~~~~~~~
55Universe inconsistency.
66 Working on: ./universes001.idr.x
77 Old domain: (5,5)
88 New domain: (5,4)
99 Involved constraints:
10− ConstraintFC {uconstraint = ./universes001.idr.x <= ./universes001.idr.z, ufc = universes001.idr:7:5-21}
10+ ConstraintFC {uconstraint = ./universes001.idr.x <= ./universes001.idr.z, ufc = universes001.idr:7:7-21}
1111 ConstraintFC {uconstraint = ./universes001.idr.x < ./universes001.idr.y, ufc = universes001.idr:1:6-8}
1212 ConstraintFC {uconstraint = ./universes001.idr.z < ./universes001.idr.x, ufc = universes001.idr:1:6-8}
13− ConstraintFC {uconstraint = ./universes001.idr.x <= ./universes001.idr.z, ufc = universes001.idr:7:5-21}
13+ ConstraintFC {uconstraint = ./universes001.idr.x <= ./universes001.idr.z, ufc = universes001.idr:7:7-21}
1414
test/universes002/expected+4−4
@@ -1,14 +1,14 @@
1−universes002.idr:45:9-48:
1+universes002.idr:45:11-48:
22 |
3345 | russell = lemma (MkMPair (MkMPair R lemma) REFL)
4− | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55Universe inconsistency.
66 Working on: ./universes002.idr.b1
77 Old domain: (5,5)
88 New domain: (5,4)
99 Involved constraints:
10− ConstraintFC {uconstraint = ./universes002.idr.b1 <= ./universes002.idr.e7, ufc = universes002.idr:45:9-48}
10+ ConstraintFC {uconstraint = ./universes002.idr.b1 <= ./universes002.idr.e7, ufc = universes002.idr:45:11-48}
1111 ConstraintFC {uconstraint = ./universes002.idr.b1 < ./universes002.idr.c1, ufc = universes002.idr:3:6-10}
12− ConstraintFC {uconstraint = ./universes002.idr.b1 <= ./universes002.idr.e7, ufc = universes002.idr:45:9-48}
12+ ConstraintFC {uconstraint = ./universes002.idr.b1 <= ./universes002.idr.e7, ufc = universes002.idr:45:11-48}
1313 ConstraintFC {uconstraint = ./universes002.idr.d1 <= ./universes002.idr.b1, ufc = universes002.idr:3:6-10}
1414