<commit_before>open Prelude

type runtime_typ =
    RTNumber
  | RTString
  | RTBoolean
  | RTFunction
  | RTObject
  | RTUndefined

module RTSet : Set.S
  with type elt = runtime_typ

module RTSetExt : SetExt.S
  with type elt = runtime_typ
  and type t = RTSet.t

type abs_value =
    AVType of RTSet.t
  | AVTypeof of id
  | AVString of string
  | AVTypeIs of id * RTSet.t

type runtime_typs = RTSet.t

type constr = string

type typ = 
    TApp of constr * typ list
  | TUnion of typ * typ
  | TArrow of typ * typ list * typ
  | TObject of (id * typ) list
  | TRef of typ
  | TTop
  | TBot


type annotation =
    ATyp of typ
  | AConstructor of typ 
  | AMutable

(** Typed JavaScript expressions. Additional well-formedness criteria are
    inline. *)
type 'a exp
  = EString of 'a * string
  | ERegexp of 'a * string * bool * bool
  | ENum of 'a * float
  | EInt of 'a * int
  | EBool of 'a * bool
  | ENull of 'a
  | EArray of 'a * 'a exp list
  | EObject of 'a * (string * bool * 'a exp) list
      (* [Typedjs_fromExpr.from_exprjs] ensures that the field names are 
         unique. If the [bool] on a field is true, the field is mutable. *)
  | EThis of 'a
  | EId of 'a * id
  | EBracket of 'a * 'a exp * 'a exp
  | ENew of 'a * 'a exp * 'a exp list
  | EPrefixOp of 'a * JavaScript_syntax.prefixOp * 'a exp
  | EInfixOp of 'a * JavaScript_syntax.infixOp * 'a exp * 'a exp
  | EIf of 'a * 'a exp * 'a exp * 'a exp
  | EAssign of 'a * 'a lvalue * 'a exp
  | EApp of 'a * 'a exp * 'a exp list
  | EFunc of 'a * id list * typ * 'a exp
      (* [Typedjs_fromExpr.from_exprjs] ensures that the argument names are
         unique. *)
  | EUndefined of 'a
  | ELet of 'a * id * 'a exp * 'a exp
  | ERec of (id * typ * 'a exp) list * 'a exp
  | ESeq of 'a * 'a exp * 'a exp
  | ELabel of 'a * id * typ * 'a exp 
      (** A labelled jump has a type-annotation to aid the type-checker. Without
          the annotation, we would have to union the types of all [EBreak]s to
          each label. *)
  | EBreak of 'a * id * 'a exp
  | ETryCatch of 'a * 'a exp * id * 'a exp
  | ETryFinally of 'a * 'a exp * 'a exp
  | EThrow of 'a * 'a exp
  | ETypecast of 'a * runtime_typs * 'a exp

and 'a lvalue =
    LVar of 'a * id
  | LProp of 'a * 'a exp * 'a exp


module type EnvType = sig
  
  type env

  val empty_env : env

  val bind_id : id -> typ -> env -> env

  val bind_lbl : id -> typ -> env -> env

  val lookup_id : id -> env -> typ

  val lookup_lbl : id -> env -> typ<commit_msg>removed stupid type parameters from Exprjs<commit_after>open Prelude

type runtime_typ =
    RTNumber
  | RTString
  | RTBoolean
  | RTFunction
  | RTObject
  | RTUndefined

module RTSet : Set.S
  with type elt = runtime_typ

module RTSetExt : SetExt.S
  with type elt = runtime_typ
  and type t = RTSet.t

type abs_value =
    AVType of RTSet.t
  | AVTypeof of id
  | AVString of string
  | AVTypeIs of id * RTSet.t

type runtime_typs = RTSet.t

type constr = string

type typ = 
    TApp of constr * typ list
  | TUnion of typ * typ
  | TArrow of typ * typ list * typ
  | TObject of (id * typ) list
  | TRef of typ
  | TTop
  | TBot


type annotation =
    ATyp of typ
  | AConstructor of typ 
  | AMutable

(** Typed JavaScript expressions. Additional well-formedness criteria are
    inline. *)
type exp
  = EString of pos * string
  | ERegexp of pos * string * bool * bool
  | ENum of pos * float
  | EInt of pos * int
  | EBool of pos * bool
  | ENull of pos
  | EArray of pos * exp list
  | EObject of pos * (string * bool * exp) list
      (* [Typedjs_fromExpr.from_exprjs] ensures that the field names are 
         unique. If the [bool] on a field is true, the field is mutable. *)
  | EThis of pos
  | EId of pos * id
  | EBracket of pos * exp * exp
  | ENew of pos * exp * exp list
  | EPrefixOp of pos * JavaScript_syntax.prefixOp * exp
  | EInfixOp of pos * JavaScript_syntax.infixOp * exp * exp
  | EIf of pos * exp * exp * exp
  | EAssign of pos * lvalue * exp
  | EApp of pos * exp * exp list
  | EFunc of pos * id list * typ * exp
      (* [Typedjs_fromExpr.from_exprjs] ensures that the argument names are
         unique. *)
  | EUndefined of pos
  | ELet of pos * id * exp * exp
  | ERec of (id * typ * exp) list * exp
  | ESeq of pos * exp * exp
  | ELabel of pos * id * typ * exp 
      (** A labelled jump has a type-annotation to aid the type-checker. Without
          the annotation, we would have to union the types of all [EBreak]s to
          each label. *)
  | EBreak of pos * id * exp
  | ETryCatch of pos * exp * id * exp
  | ETryFinally of pos * exp * exp
  | EThrow of pos * exp
  | ETypecast of pos * runtime_typs * exp

and lvalue =
    LVar of pos * id
  | LProp of pos * exp * exp


module type EnvType = sig
  
  type env

  val empty_env : env

  val bind_id : id -> typ -> env -> env

  val bind_lbl : id -> typ -> env -> env

  val lookup_id : id -> env -> typ

  val lookup_lbl : id -> env -> typ
{'fraction_non_alphanumeric': 0.09454250355041591, 'fraction_numerical': 0.0, 'mean_word_length': 2.3423728813559324, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2861999', 'n_tokens_mistral': 1785, 'n_tokens_neox': 1763, 'n_words': 705}