Js_parser.Parser_common
type pattern_errors = {
if_expr: list((Loc.t, Parse_error.t)),
if_patt: list((Loc.t, Parse_error.t)),
};
type pattern_cover =
| Cover_expr(Flow_ast.Expression.t(Loc.t, Loc.t))
| Cover_patt(Flow_ast.Expression.t(Loc.t, Loc.t), pattern_errors)
;
module type PARSER = { ... };
let identifier_name_raw: Parser_env.env => string;
let identifier_name: Parser_env.env => (Loc.t, Flow_ast.Identifier.t'(Loc.t));
let private_identifier:
Parser_env.env =>
(Loc.t, Flow_ast.PrivateName.t'(Loc.t));
PrivateIdentifier - https://tc39.es/ecma262/#prod-PrivateIdentifier
N.B.: whitespace, line terminators, and comments are not allowed between the # and IdentifierName because PrivateIdentifier is a CommonToken which is considered a single token. See also https://tc39.es/ecma262/#prod-InputElementDiv
let is_simple_parameter_list:
('a, Flow_ast.Function.Params.t'('b, 'c)) =>
bool;
The operation IsSimpleParamterList https://tc39.es/ecma262/#sec-static-semantics-issimpleparameterlist
* The abstract operation IsLabelledFunction * * https://tc39.github.io/ecma262/#sec-islabelledfunction
let assert_identifier_name_is_identifier:
?restricted_error:Parse_error.t =>
Parser_env.env =>
(Loc.t, Flow_ast.Identifier.t'('a)) =>
unit;
https://tc39.es/ecma262/#sec-exports-static-semantics-early-errors
let with_loc:
?start_loc:Loc.t =>
(Parser_env.env => 'a) =>
Parser_env.env =>
(Loc.t, 'a);
let with_loc_opt:
?start_loc:Loc.t =>
(Parser_env.env => option('a)) =>
Parser_env.env =>
option((Loc.t, 'a));
let with_loc_extra:
?start_loc:Loc.t =>
(Parser_env.env => ('a, 'b)) =>
Parser_env.env =>
((Loc.t, 'a), 'b);