Module Ast_js

type tok = Parse_info.t
type 'a wrap = 'a * tok
type 'a bracket = tok * 'a * tok
type name = string wrap
type ident = string wrap
type qualified_name = string
type resolved_name =
| Local
| Param
| Global of qualified_name
| NotResolved
type special =
| Null
| Undefined
| This
| Super
| Exports
| Module
| Define
| Arguments
| New
| NewTarget
| Eval
| Seq
| Void
| Typeof
| Instanceof
| In
| Delete
| Spread
| Yield
| YieldStar
| Await
| Encaps of name option
| Require
| UseStrict
| ArithOp of Ast_generic.arithmetic_operator
| IncrDecr of Ast_generic.incr_decr * Ast_generic.prefix_postfix
type label = string wrap
type filename = string wrap
val default_entity : string
type property_name =
| PN of name
| PN_Computed of expr
and expr =
| Bool of bool wrap
| Num of string wrap
| String of string wrap
| Regexp of string wrap
| Id of name * resolved_name Stdlib.ref
| IdSpecial of special wrap
| Nop
| Assign of expr * tok * expr
| Obj of obj_
| Class of class_ * name option
| ObjAccess of expr * tok * property_name
| Arr of expr list bracket
| ArrAccess of expr * expr
| Fun of fun_ * name option
| Apply of expr * expr list
| Xml of xml
| Conditional of expr * expr * expr
| Ellipsis of tok
and xml = {
xml_tag : ident;
xml_attrs : (ident * xml_attr_value) list;
xml_body : xml_body list;
}
and xml_attr_value = expr
and xml_body =
| XmlText of string wrap
| XmlExpr of expr
| XmlXml of xml
and stmt =
| VarDecl of var
| Block of stmt list
| ExprStmt of expr
| If of tok * expr * stmt * stmt
| Do of tok * stmt * expr
| While of tok * expr * stmt
| For of tok * for_header * stmt
| Switch of tok * expr * case list
| Continue of tok * label option
| Break of tok * label option
| Return of tok * expr
| Label of label * stmt
| Throw of tok * expr
| Try of tok * stmt * catch option * (tok * stmt) option
and for_header =
| ForClassic of vars_or_expr * expr * expr
| ForIn of var_or_expr * tok * expr
and vars_or_expr = (var listexpr) Common.either
and var_or_expr = (varexpr) Common.either
and case =
| Case of tok * expr * stmt
| Default of tok * stmt
and catch = tok * name * stmt
and var = {
v_name : name;
v_kind : var_kind wrap;
v_init : expr;
v_resolved : resolved_name Stdlib.ref;
}
and var_kind =
| Var
| Let
| Const
and fun_ = {
f_props : fun_prop wrap list;
f_params : parameter_binding list;
f_body : stmt;
}
and parameter_binding =
| ParamClassic of parameter
| ParamEllipsis of tok
and parameter = {
p_name : name;
p_default : expr option;
p_dots : tok option;
}
and fun_prop =
| Generator
| Async
| Get
| Set
and obj_ = property list bracket
and class_ = {
c_extends : expr option;
c_body : property list bracket;
}
and property =
| Field of property_name * property_prop wrap list * expr
| FieldSpread of tok * expr
| FieldEllipsis of tok
and property_prop =
| Static
| Public
| Private
| Protected
type module_directive =
| Import of tok * name * name option * filename
| Export of name
| ModuleAlias of tok * name * filename
| ImportCss of filename
| ImportEffect of tok * filename
type toplevel =
| V of var
| S of tok * stmt
| M of module_directive
type program = toplevel list
type any =
| Expr of expr
| Stmt of stmt
| Item of toplevel
| Items of toplevel list
| Program of program
val str_of_name : ('a * 'b) -> 'a
val tok_of_name : ('a * 'b) -> 'b
val unwrap : ('a * 'b) -> 'a
val string_of_xhp_tag : 'a -> 'a