Open trdthg opened 2 months ago
Hmm, well spotted! The lexer forbids operators starting with either //
or /*
, but those characters are generally allowed within operators. It might be better if we were to forbid //
and /*
anywhere within an operator, assuming there is a nice way to do that in ocamllex
I find it strange how
sail
currently handlesoperator + comment
forms like==/**/
or=/**/
.It seems the issue is caused by the
operatorn
rule inlexel.mll
. To debug this, I added some print statements inside:When I format the following code:
Here is the output:
Comments are treated as part of the operator (although they are valid operators in the documentation?).
if this behavior is valid, then we should fix the error? if not, is there a way to separate the comment? any advice?