mirror of
https://github.com/idris-lang/Idris2.git
synced 2025-01-01 16:12:26 +03:00
Better parse error for missing paren after with
This commit is contained in:
parent
912112ba97
commit
04e65529f6
@ -1050,7 +1050,7 @@ withFlags fname
|
||||
withProblem : OriginDesc -> Int -> IndentInfo -> Rule PWithProblem
|
||||
withProblem fname col indents
|
||||
= do rig <- multiplicity fname
|
||||
start <- bounds (decoratedSymbol fname "(")
|
||||
start <- mustWork $ bounds (decoratedSymbol fname "(")
|
||||
wval <- bracketedExpr fname start indents
|
||||
prf <- optional (decoratedKeyword fname "proof"
|
||||
*> UN . Basic <$> decoratedSimpleBinderName fname)
|
||||
|
@ -81,7 +81,7 @@ idrisTestsError = MkTestPool "Error messages" [] Nothing
|
||||
-- Parse errors
|
||||
"perror001", "perror002", "perror003", "perror004", "perror005",
|
||||
"perror006", "perror007", "perror008", "perror009", "perror010",
|
||||
"perror011", "perror012", "perror013", "perror014"]
|
||||
"perror011", "perror012", "perror013", "perror014", "perror015"]
|
||||
|
||||
idrisTestsInteractive : TestPool
|
||||
idrisTestsInteractive = MkTestPool "Interactive editing" [] Nothing
|
||||
|
4
tests/idris2/perror015/ParseWith.idr
Normal file
4
tests/idris2/perror015/ParseWith.idr
Normal file
@ -0,0 +1,4 @@
|
||||
foo : Nat -> Nat
|
||||
foo a with a
|
||||
_ | 0 = a
|
||||
_ | S k = a
|
8
tests/idris2/perror015/expected
Normal file
8
tests/idris2/perror015/expected
Normal file
@ -0,0 +1,8 @@
|
||||
1/1: Building ParseWith (ParseWith.idr)
|
||||
Error: Expected '('.
|
||||
|
||||
ParseWith:2:12--2:13
|
||||
1 | foo : Nat -> Nat
|
||||
2 | foo a with a
|
||||
^
|
||||
|
3
tests/idris2/perror015/run
Executable file
3
tests/idris2/perror015/run
Executable file
@ -0,0 +1,3 @@
|
||||
rm -rf build
|
||||
|
||||
$1 --no-color --console-width 0 --check ParseWith.idr || true
|
Loading…
Reference in New Issue
Block a user