package tiny_languages

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Js_astSource

Sourcetype expr =
  1. | Number of float
  2. | String of string
  3. | Bool of bool
  4. | Null
  5. | Name of string
  6. | This
  7. | Array of expr list
  8. | Object of (string * expr) list
  9. | Function of func
  10. | Unary of string * expr
  11. | Update of string * bool * expr
  12. | Binary of string * expr * expr
  13. | Logical of string * expr * expr
  14. | Assign of string * expr * expr
  15. | Conditional of expr * expr * expr
  16. | Member of expr * string
  17. | Index of expr * expr
  18. | Call of expr * expr list
  19. | New of expr * expr list
  20. | Regex of string * string
Sourceand func = {
  1. name : string option;
  2. params : string list;
  3. body : stmt list;
  4. arrow : bool;
}
Sourceand stmt = {
  1. line : int;
  2. stmt : statement;
}
Sourceand statement =
  1. | Expr of expr
  2. | Let of let_kind * (string * expr option) list
  3. | Function_decl of func
  4. | Return of expr option
  5. | If of expr * stmt * stmt option
  6. | While of expr * stmt
  7. | For of stmt option * expr option * expr option * stmt
  8. | For_of of let_kind * string * expr * stmt
  9. | Break
  10. | Continue
  11. | Throw of expr
  12. | Try of stmt list * string * stmt list
  13. | Block of stmt list
  14. | Empty
Sourceand let_kind =
  1. | Let_kind
  2. | Const_kind
  3. | Var_kind
Sourcetype program = stmt list
Sourceval number_to_string : float -> string
Sourceval expr_to_string : expr -> string
Sourceval stmt_to_string : stmt -> string