Skip to content

Commit 68c32ab

Browse files
committed
Fix: ! is represented internally as "not".
1 parent e0f9330 commit 68c32ab

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

analysis/src/SemanticTokens.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,9 @@ let parser ~debug ~emitter ~path =
236236
emitter |> emitFromLoc ~loc:e.pexp_loc ~type_;
237237
Ast_mapper.default_mapper.expr mapper e
238238
| Pexp_ident {txt = lid; loc} ->
239-
emitter
240-
|> emitLongident ~pos:(Utils.tupleOfLexing loc.loc_start) ~lid ~debug;
239+
if lid <> Lident "not" then
240+
emitter
241+
|> emitLongident ~pos:(Utils.tupleOfLexing loc.loc_start) ~lid ~debug;
241242
Ast_mapper.default_mapper.expr mapper e
242243
| Pexp_apply ({pexp_desc = Pexp_ident lident; pexp_loc}, args)
243244
when Res_parsetree_viewer.isJsxExpression e ->

analysis/tests/src/Parser.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type pairIntString = list<
2929
>,
3030
>
3131

32-
let _ = 3 < 4 || 3 > 4
32+
let _ = !(3 < 4) || 3 > 4
3333

3434
module type MT = {
3535
module DDF: {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ TypeArg: (26,4)->(26,50)
4545
TypeArg: (27,4)->(27,53)
4646
Lident: looooooooooooooooooooooooooooooooooooooong_int (26,4) Type
4747
Lident: looooooooooooooooooooooooooooooooooooooong_string (27,4) Type
48-
Binary operator < (31,10)->(31,11)
49-
Binary operator > (31,19)->(31,20)
48+
Binary operator < (31,12)->(31,13)
49+
Binary operator > (31,22)->(31,23)
5050
Lident: MT (33,12) Type
5151
Lident: DDF (34,9) Namespace
5252
Lident: DDF (39,7) Namespace

0 commit comments

Comments
 (0)