[parser] error message if use let-in in do block

This commit is contained in:
Alexander 2023-06-13 10:35:39 +03:00
parent 26c5c4db03
commit a01b7e25d9

View File

@ -922,8 +922,11 @@ mutual
<|> do decoratedKeyword fname "let"
commit
res <- nonEmptyBlock (letBlock fname)
atEnd indents
pure (mkDoLets fname res)
do b <- bounds (decoratedKeyword fname "in")
fatalLoc {c = True} b.bounds "Let-in not supported in do block. Did you mean (let ... in ...)?"
<|>
do atEnd indents
pure (mkDoLets fname res)
<|> do b <- bounds (decoratedKeyword fname "rewrite" *> expr pdef fname indents)
atEnd indents
pure [DoRewrite (boundToFC fname b) b.val]