I think that the lexer in many languages does not handle line numbers correctly.
For example, if I run miniml on the following program
let f = fun f (x : int) : int is x + 1 ;;
f false ;;
it reports
$ ./miniml.native test
f : int -> int = <fun>
Type error at file "test", **line 1, charaters 44-49:**
This expression has type bool but is used as if it has type int
but the error is on the second line.
To fix it, I believe, you need to manually update the line number in the lexbuf, as I've done in my fork of the repository. I can make a pull request if you agree that it's the right call to make this change in all the similar lexers.
I think that the lexer in many languages does not handle line numbers correctly. For example, if I run
miniml
on the following programit reports
but the error is on the second line. To fix it, I believe, you need to manually update the line number in the lexbuf, as I've done in my fork of the repository. I can make a pull request if you agree that it's the right call to make this change in all the similar lexers.