asoffer / Icarus

An experimental general-purpose programming language
Apache License 2.0
9 stars 2 forks source link

Highlighting is wrong for `NoBlockWithName` errors #56

Closed perimosocordiae closed 3 years ago

perimosocordiae commented 3 years ago

Reproducer:

-- ::= import "core.ic"
io ::= import "io.ic"

if (true) do {
  io.Print("yes\n")
} else {
  io.Print("no\n")
}

Observed output:

Error in examples/repro.ic: No block on this scope with the name `do`.

4 | if (true) do { 5 | io.Print("yes\n")

I replaced the red text in the actual output with bold markup here to demonstrate the issue. Somehow, the source highlight is starting at the right place but continuing too far. If you change the contents of the "yes\n" string, it always highlights up to but not including the final doublequote.