Improve error message and some tests

This commit is contained in:
Iavor Diatchki 2021-04-29 14:42:43 -07:00
parent 3cb97094b9
commit f43d652337
7 changed files with 22 additions and 4 deletions

View File

@ -81,11 +81,11 @@ lexerP k = P $ \cfg p s ->
T.unpack (tokenText it)
MalformedSelector -> "malformed selector: " ++
T.unpack (tokenText it)
InvalidIndentation c -> "invalid indentation, expected " ++
InvalidIndentation c -> "invalid indentation, unmatched " ++
case c of
Sym CurlyR -> "}"
Sym ParenR -> ")"
Sym BracketR -> "]"
Sym CurlyR -> "{ ... } "
Sym ParenR -> "( ... )"
Sym BracketR -> "[ ... ]"
_ -> show c -- basically panic
]
where it = thing t

5
tests/issues/T1179.cry Normal file
View File

@ -0,0 +1,5 @@
module T1179 where
x = 0x2
private
y = x

1
tests/issues/T1179.icry Normal file
View File

@ -0,0 +1 @@
:load T1179.cry

View File

@ -0,0 +1,3 @@
Loading module Cryptol
Loading module Cryptol
Loading module T1179

View File

@ -0,0 +1,4 @@
module Layout02 where
x = 0x1 where y = ( 2
)

View File

@ -0,0 +1 @@
:load Layout02.cry

View File

@ -0,0 +1,4 @@
Loading module Cryptol
Parse error at Layout02.cry:4:11--4:11
invalid indentation, unmatched ( ... )