Skip to content

Commit a799d94

Browse files
committed
Fix == and ===.
1 parent 68c32ab commit a799d94

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

analysis/src/SemanticTokens.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,10 @@ let parser ~debug ~emitter ~path =
224224
let expr (mapper : Ast_mapper.mapper) (e : Parsetree.expression) =
225225
match e.pexp_desc with
226226
| Pexp_ident {txt = Lident id}
227-
when snd (Utils.tupleOfLexing e.pexp_loc.loc_end)
228-
- snd (Utils.tupleOfLexing e.pexp_loc.loc_start)
229-
> String.length id
227+
when id <> "=" && id <> "=="
228+
&& snd (Utils.tupleOfLexing e.pexp_loc.loc_end)
229+
- snd (Utils.tupleOfLexing e.pexp_loc.loc_start)
230+
> String.length id
230231
(* /"stuff" *) ->
231232
let type_ = Token.Variable in
232233
if debug then

analysis/tests/src/Parser.res

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,5 @@ let _ = x =>
126126
| #stuff => 3
127127
| #...QQ.somePolyEnumType => 4
128128
}
129+
130+
let _ = 3 == 3 || 3 === 3

analysis/tests/src/expected/Parser.res.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Parse tests/src/Parser.res
2-
structure items:35 diagnostics:0
2+
structure items:36 diagnostics:0
33
Lident: M (0,7) Namespace
44
Lident: C (1,9) Namespace
55
Lident: Component (1,13) Namespace

0 commit comments

Comments
 (0)