Idris2 icon indicating copy to clipboard operation
Idris2 copied to clipboard

Incorrect span error with mismatched comment block containing a nested comment block

Open ohad opened this issue 1 year ago • 0 comments

Steps to Reproduce

public export
Hmmm : Nat
{-
-}-}

Expected Behavior

Report a parse error on the final -} on the final line.

--  line 3 col 0:
     Couldn't parse declaration.
     
     :3:1--3:2
      1 | public export
      2 | Hmmm : Nat
      3 | -}
          ^
     

Observed Behavior

Report a parse error on the public on the first line.

line 1 col 0:
     Keyword 'public' is not a valid start to a declaration.
     
     :1:1--1:7
      1 | public export
          ^^^^^^

Removing the properly nested, inner comment makes idris report the correct place.

ohad avatar Mar 01 '23 12:03 ohad