Special treatment for variants location in json output.
The location of variants declarations in the typed tree includes the "|" and whatever spaces are there.
This complicates adding annotations that need to handle a number of special cases.
For B and C we take the convention of adding the annotation 2 characters after the reported location. Which is not good for A|B|C but works well on formatted code.
Special treatment for variants location in json output.
The location of variants declarations in the typed tree includes the "|" and whatever spaces are there. This complicates adding annotations that need to handle a number of special cases.
E.g.
The locations are as follows:
A
and| B
and| C
.Because of this issue https://github.com/rescript-lang/syntax/issues/506 the case of
A
needs to be special-cased by adding|
.For
B
andC
we take the convention of adding the annotation 2 characters after the reported location. Which is not good forA|B|C
but works well on formatted code.