Skip to content

Commit 7f238d9

Browse files
SamChou19815meta-codesync[bot]
authored andcommitted
[flow] Remove some unused parser functions
Reviewed By: gkz, panagosg7 Differential Revision: D87480693 fbshipit-source-id: b08d946421e5b93e4ddbabb0292dd3a48a952aa1
1 parent ba59300 commit 7f238d9

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

src/parser/parser_env.ml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,6 @@ let with_in_formal_parameters in_formal_parameters env =
392392
else
393393
{ env with in_formal_parameters }
394394

395-
let with_in_function in_function env =
396-
if in_function = env.in_function then
397-
env
398-
else
399-
{ env with in_function }
400-
401395
let with_in_match_expression in_match_expression env =
402396
if in_match_expression = env.in_match_expression then
403397
env
@@ -587,19 +581,6 @@ let is_contextually_reserved str_val =
587581
true
588582
| _ -> false
589583

590-
(** Words that are sometimes reserved, and sometimes allowed as identifiers
591-
(namely "await" and "yield")
592-
593-
https://tc39.es/ecma262/#sec-keywords-and-reserved-words *)
594-
let token_is_contextually_reserved t =
595-
let open Token in
596-
match t with
597-
| T_IDENTIFIER { raw; _ } -> is_contextually_reserved raw
598-
| T_AWAIT
599-
| T_YIELD ->
600-
true
601-
| _ -> false
602-
603584
(** Words that are always reserved (mostly keywords)
604585
605586
https://tc39.es/ecma262/#sec-keywords-and-reserved-words *)
@@ -1034,10 +1015,6 @@ module Peek = struct
10341015
error) *)
10351016
let is_identifier env = ith_is_identifier ~i:0 env
10361017

1037-
let is_identifier_name env = ith_is_identifier_name ~i:0 env
1038-
1039-
let is_type_identifier env = ith_is_type_identifier ~i:0 env
1040-
10411018
let is_function env =
10421019
token env = T_FUNCTION
10431020
|| token env = T_ASYNC

src/parser/parser_env.mli

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ val with_strict : bool -> env -> env
153153

154154
val with_in_formal_parameters : bool -> env -> env
155155

156-
val with_in_function : bool -> env -> env
157-
158156
val with_in_match_expression : bool -> env -> env
159157

160158
val with_in_match_statement : bool -> env -> env
@@ -201,8 +199,6 @@ val is_contextually_reserved : string -> bool
201199

202200
val is_reserved : string -> bool
203201

204-
val token_is_contextually_reserved : Token.t -> bool
205-
206202
val token_is_reserved : Token.t -> bool
207203

208204
val token_is_reserved_type : Token.t -> bool
@@ -238,10 +234,6 @@ module Peek : sig
238234

239235
val is_identifier : env -> bool
240236

241-
val is_type_identifier : env -> bool
242-
243-
val is_identifier_name : env -> bool
244-
245237
val is_function : env -> bool
246238

247239
val is_hook : env -> bool

0 commit comments

Comments
 (0)