fix: trailing ';' at end of input

This commit is contained in:
Leonardo de Moura 2020-09-27 16:58:23 -07:00
parent fbe1a94549
commit 39f8fd8eb9
2 changed files with 7 additions and 1 deletions

View file

@ -78,7 +78,7 @@ withPosition fun pos₁ =>
("; "
-- check indentation
>> checkColGe pos₁.column "do-elements must be indented"
>> notFollowedByCommandToken)
>> notFollowedByCommandToken >> notFollowedBy eoi)
>> optional (try ("; " >> notFollowedByTermToken >> notFollowedBy (ident <|> numLit <|> strLit <|> charLit <|> nameLit)))
def doSeqBracketed := parser! "{" >> sepBy1 doElemParser "; " true >> "}"
def doSeq := doSeqBracketed <|> doSeqIndent

View file

@ -0,0 +1,6 @@
new_frontend
def f (x : Nat) : IO Nat := do
IO.println x;
pure x;