diff options
author | Louis Roché <louis@louisroche.net> | 2019-03-24 07:42:42 +0000 |
---|---|---|
committer | Louis Roché <louis@louisroche.net> | 2019-04-08 00:51:09 +0000 |
commit | 4fee3012807b870f6e8d3195919275ef691a60d8 (patch) | |
tree | 15019da4d298c6feae19c129c644407e78d27963 /testsuite/tests/letrec-check/extension_constructor.ml | |
parent | f5802c28c6e95488e3758206e732ca30d0d7137b (diff) | |
download | ocaml-4fee3012807b870f6e8d3195919275ef691a60d8.tar.gz |
Print end line and valid end character for multi-lines locations
When a location is related to multiple lines of code, it is printed
incorrectly. More specifically, the end character is actually an
offset between the beginning and the end of the location.
This commit changes the format of the locations when they cover
multiple lines. It adds the end line and the end character is now a
proper column rather than an offset. It doesn't affect locations
related to a single line.
The old format was:
```
Line STARTLINE, characters STARTCHAR-OFFSET
```
The new format is:
```
Lines STARTLINE-ENDLINE, characters STARTCHAR-ENDCHAR
```
Diffstat (limited to 'testsuite/tests/letrec-check/extension_constructor.ml')
-rw-r--r-- | testsuite/tests/letrec-check/extension_constructor.ml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/letrec-check/extension_constructor.ml b/testsuite/tests/letrec-check/extension_constructor.ml index e581a0acf6..93171ae1dc 100644 --- a/testsuite/tests/letrec-check/extension_constructor.ml +++ b/testsuite/tests/letrec-check/extension_constructor.ml @@ -18,7 +18,7 @@ let rec x = and (m : (module T)) = (module (struct exception A of int end) : T);; [%%expect{| -Line 2, characters 2-36: +Lines 2-3, characters 2-8: 2 | ..let module M = (val m) in 3 | M.A 42 Error: This kind of expression is not allowed as right-hand side of `let rec' |