Skip to content

Commit 7cb3dd9

Browse files
committed
True/false: pattern case was missing.
1 parent a45e936 commit 7cb3dd9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

analysis/src/SemanticTokens.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ let parser ~debug ~emitter ~path =
200200
if isLowercaseId id then
201201
emitter |> emitVariable ~id ~debug ~loc:p.ppat_loc;
202202
Ast_mapper.default_mapper.pat mapper p
203+
| Ppat_construct ({txt = Lident ("true" | "false")}, _) ->
204+
(* Don't emit true or false *)
205+
Ast_mapper.default_mapper.pat mapper p
203206
| Ppat_record (cases, _) ->
204207
cases
205208
|> List.iter (fun (label, _) -> emitter |> emitRecordLabel ~label ~debug);
@@ -214,7 +217,8 @@ let parser ~debug ~emitter ~path =
214217
| Pexp_ident {txt = Lident id}
215218
when snd (Utils.tupleOfLexing e.pexp_loc.loc_end)
216219
- snd (Utils.tupleOfLexing e.pexp_loc.loc_start)
217-
> String.length id (* /"stuff" *) ->
220+
> String.length id
221+
(* /"stuff" *) ->
218222
let type_ = Token.Variable in
219223
if debug then
220224
Printf.printf "QuotedIdent: %s %s %s\n" id

0 commit comments

Comments
 (0)