Module Js_parser.Parser_env

module SSet: Flow_set.S with type elt = string;
module Lex_mode: { ... };
type token_sink_result = {
  1. token_loc: Loc.t,
  2. token: Token.t,
  3. token_context: Lex_mode.t,
};
type parse_options = {
  1. components: bool,
  2. enums: bool,
    /*

    enable parsing of Flow enums

    */
  3. esproposal_decorators: bool,
    /*

    enable parsing of decorators

    */
  4. types: bool,
    /*

    enable parsing of Flow types

    */
  5. use_strict: bool,
    /*

    treat the file as strict, without needing a "use strict" directive

    */
  6. module_ref_prefix: option(string),
  7. module_ref_prefix_LEGACY_INTEROP: option(string),
};
let default_parse_options: parse_options;
type env;
type allowed_super =
  1. | No_super
  2. | Super_prop
  3. | Super_prop_or_call
;
let init_env: ?token_sink:option((token_sink_result => unit)) => ?parse_options:option(parse_options) => option(File_key.t) => string => env;
let in_strict_mode: env => bool;
let last_loc: env => option(Loc.t);
let last_token: env => option(Token.t);
let in_export: env => bool;
let in_export_default: env => bool;
let labels: env => SSet.t;
let comments: env => list(Flow_ast.Comment.t(Loc.t));
let in_loop: env => bool;
let in_switch: env => bool;
let in_formal_parameters: env => bool;
let in_function: env => bool;
let allow_yield: env => bool;
let allow_await: env => bool;
let allow_directive: env => bool;
let allow_super: env => allowed_super;
let has_simple_parameters: env => bool;
let no_in: env => bool;
let no_call: env => bool;
let no_let: env => bool;
let no_anon_function_type: env => bool;
let no_conditional_type: env => bool;
let no_new: env => bool;
let errors: env => list((Loc.t, Parse_error.t));
let parse_options: env => parse_options;
let source: env => option(File_key.t);
let should_parse_types: env => bool;
let error_at: env => (Loc.t, Parse_error.t) => unit;
let error: env => Parse_error.t => unit;
let error_unexpected: ?expected:string => env => unit;
let error_on_decorators: env => list((Loc.t, 'a)) => unit;
let error_nameless_declaration: env => string => unit;
let strict_error: env => Parse_error.t => unit;
let strict_error_at: env => (Loc.t, Parse_error.t) => unit;
let function_as_statement_error_at: env => Loc.t => unit;
let error_list: env => list((Loc.t, Parse_error.t)) => unit;
let enter_class: env => unit;
let exit_class: env => unit;
let add_declared_private: env => string => unit;
let add_used_private: env => string => Loc.t => unit;
let consume_comments_until: env => Loc.position => unit;
let with_strict: bool => env => env;
let with_in_formal_parameters: bool => env => env;
let with_in_function: bool => env => env;
let with_allow_yield: bool => env => env;
let with_allow_await: bool => env => env;
let with_allow_directive: bool => env => env;
let with_allow_super: allowed_super => env => env;
let with_no_let: bool => env => env;
let with_in_loop: bool => env => env;
let with_no_in: bool => env => env;
let with_no_anon_function_type: bool => env => env;
let with_no_conditional_type: bool => env => env;
let with_no_new: bool => env => env;
let with_in_switch: bool => env => env;
let with_in_export: bool => env => env;
let with_in_export_default: bool => env => env;
let with_no_call: bool => env => env;
let with_error_callback: (env => Parse_error.t => unit) => env => env;
let without_error_callback: env => env;
let add_label: env => string => env;
let enter_function: env => async:bool => generator:bool => simple_params:bool => env;
let is_contextually_reserved: string => bool;
let is_reserved: string => bool;
let token_is_contextually_reserved: Token.t => bool;
let token_is_reserved: Token.t => bool;
let token_is_reserved_type: Token.t => bool;
let token_is_type_identifier: env => Token.t => bool;
let token_is_variance: Token.t => bool;
let is_strict_reserved: string => bool;
let token_is_strict_reserved: Token.t => bool;
let is_restricted: string => bool;
let is_reserved_type: string => bool;
module Peek: { ... };
module Eat: { ... };
module Expect: { ... };
module Try: { ... };