package pfff

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module PI = Parse_info
type tok = Parse_info.t
and 'a wrap = 'a * tok
and 'a paren = tok * 'a * tok
and 'a brace = tok * 'a * tok
and 'a bracket = tok * 'a * tok
and 'a angle = tok * 'a * tok
and 'a comma_list = ('a, tok) Common.either list
and sc = tok option
type name = string wrap
type xhp_tag = string
type module_path = string wrap
type expr =
  1. | L of literal
  2. | V of name
  3. | This of tok
  4. | Super of tok
  5. | U of unop wrap * expr
  6. | B of expr * binop wrap * expr
  7. | Period of expr * tok * name
  8. | Bracket of expr * expr bracket
  9. | Object of property comma_list brace
  10. | Array of expr comma_list bracket
  11. | Apply of expr * expr comma_list paren
  12. | Conditional of expr * tok * expr * tok * expr
  13. | Assign of expr * assignment_operator wrap * expr
  14. | Seq of expr * tok * expr
  15. | Function of func_decl
  16. | Class of class_decl
  17. | Arrow of arrow_func
  18. | Yield of tok * tok option * expr option
  19. | Await of tok * expr
  20. | NewTarget of tok * tok * tok
  21. | Encaps of name option * tok * encaps list * tok
  22. | Ellipses of tok
  23. | XhpHtml of xhp_html
  24. | Paren of expr paren
and literal =
  1. | Bool of bool wrap
  2. | Num of string wrap
  3. | String of string wrap
  4. | Regexp of string wrap
  5. | Null of tok
and unop =
  1. | U_new
  2. | U_delete
  3. | U_typeof
  4. | U_void
  5. | U_pre_increment
  6. | U_pre_decrement
  7. | U_post_increment
  8. | U_post_decrement
  9. | U_plus
  10. | U_minus
  11. | U_not
  12. | U_bitnot
  13. | U_spread
and binop =
  1. | B_instanceof
  2. | B_in
  3. | B_add
  4. | B_sub
  5. | B_mul
  6. | B_div
  7. | B_mod
  8. | B_expo
  9. | B_le
  10. | B_ge
  11. | B_lt
  12. | B_gt
  13. | B_lsr
  14. | B_asr
  15. | B_lsl
  16. | B_equal
  17. | B_notequal
  18. | B_physequal
  19. | B_physnotequal
  20. | B_bitand
  21. | B_bitor
  22. | B_bitxor
  23. | B_and
  24. | B_or
and assignment_operator =
  1. | A_eq
  2. | A_add
  3. | A_sub
  4. | A_mul
  5. | A_div
  6. | A_mod
  7. | A_lsl
  8. | A_lsr
  9. | A_asr
  10. | A_and
  11. | A_or
  12. | A_xor
and property =
  1. | P_field of property_name * tok * expr
  2. | P_method of func_decl
  3. | P_shorthand of name
  4. | P_spread of tok * expr
and property_name =
  1. | PN_Id of name
  2. | PN_String of string wrap
  3. | PN_Num of string wrap
  4. | PN_Computed of expr bracket
and xhp_html =
  1. | Xhp of xhp_tag wrap * xhp_attribute list * tok * xhp_body list * xhp_tag option wrap
  2. | XhpSingleton of xhp_tag wrap * xhp_attribute list * tok
and xhp_attribute =
  1. | XhpAttrValue of xhp_attr_name * tok * xhp_attr_value
  2. | XhpAttrNoValue of xhp_attr_name
  3. | XhpAttrSpread of (tok * expr) brace
and xhp_attr_name = string wrap
and xhp_attr_value =
  1. | XhpAttrString of string wrap
  2. | XhpAttrExpr of expr brace
and xhp_body =
  1. | XhpText of string wrap
  2. | XhpExpr of expr option brace
  3. | XhpNested of xhp_html
and encaps =
  1. | EncapsString of string wrap
  2. | EncapsExpr of tok * expr * tok
and stmt =
  1. | VarsDecl of var_kind wrap * var_binding comma_list * sc
  2. | Block of item list brace
  3. | Nop of sc
  4. | ExprStmt of expr * sc
  5. | If of tok * expr paren * stmt * (tok * stmt) option
  6. | Do of tok * stmt * tok * expr paren * sc
  7. | While of tok * expr paren * stmt
  8. | For of tok * tok * lhs_or_vars option * tok * expr option * tok * expr option * tok * stmt
  9. | ForIn of tok * tok * lhs_or_var * tok * expr * tok * stmt
  10. | ForOf of tok * tok * lhs_or_var * tok * expr * tok * stmt
  11. | Switch of tok * expr paren * case_clause list brace
  12. | Continue of tok * label option * sc
  13. | Break of tok * label option * sc
  14. | Return of tok * expr option * sc
  15. | With of tok * expr paren * stmt
  16. | Labeled of label * tok * stmt
  17. | Throw of tok * expr * sc
  18. | Try of tok * stmt * (tok * arg_catch paren * stmt) option * (tok * stmt) option
and label = string wrap
and lhs_or_vars =
  1. | LHS1 of expr
  2. | ForVars of var_kind wrap * var_binding comma_list
and lhs_or_var =
  1. | LHS2 of expr
  2. | ForVar of var_kind wrap * var_binding
and case_clause =
  1. | Default of tok * tok * item list
  2. | Case of tok * expr * tok * item list
and arg_catch = string wrap
and type_ =
  1. | TName of nominal_type
  2. | TQuestion of tok * type_
  3. | TFun of param_types * tok * type_
  4. | TObj of obj_type_member list brace
  5. | TTodo
and nominal_type = expr * type_argument comma_list angle option
and param_types = (param_name * annotation) comma_list paren
and param_name =
  1. | RequiredParam of name
  2. | OptionalParam of name * tok
  3. | RestParam of tok * name
and obj_type_member = property_name * annotation * sc
and type_argument = type_
and type_parameters = type_parameter comma_list angle
and type_parameter = name
and type_opt = annotation option
and annotation =
  1. | TAnnot of tok * type_
  2. | TFunAnnot of type_parameters option * param_types * tok * type_
and func_decl = {
  1. f_kind : func_kind;
  2. f_properties : func_property list;
  3. f_params : parameter_binding comma_list paren;
  4. f_body : item list brace;
  5. f_type_params : type_parameters option;
  6. f_return_type : type_opt;
}
and func_kind =
  1. | F_func of tok * name option
  2. | F_method of property_name
  3. | F_get of tok * property_name
  4. | F_set of tok * property_name
and func_property =
  1. | Generator of tok
  2. | Async of tok
and parameter_binding =
  1. | ParamClassic of parameter
  2. | ParamPattern of parameter_pattern
and parameter = {
  1. p_name : name;
  2. p_type : type_opt;
  3. p_default : default option;
  4. p_dots : tok option;
}
and default =
  1. | DNone of tok
  2. | DSome of tok * expr
and parameter_pattern = {
  1. ppat : pattern;
  2. ppat_type : type_opt;
  3. ppat_default : (tok * expr) option;
}
and arrow_func = {
  1. a_params : arrow_params;
  2. a_return_type : type_opt;
  3. a_tok : tok;
  4. a_body : arrow_body;
}
and arrow_params =
  1. | ASingleParam of parameter_binding
  2. | AParams of parameter_binding comma_list paren
and arrow_body =
  1. | AExpr of expr
  2. | ABody of item list brace
and var_binding =
  1. | VarClassic of variable_declaration
  2. | VarPattern of variable_declaration_pattern
and variable_declaration = {
  1. v_name : name;
  2. v_init : init option;
  3. v_type : type_opt;
}
and init = tok * expr
and var_kind =
  1. | Var
  2. | Const
  3. | Let
and variable_declaration_pattern = {
  1. vpat : pattern;
  2. vpat_init : init option;
  3. vpat_type : type_opt;
}
and pattern =
  1. | PatObj of pattern comma_list brace
  2. | PatArr of pattern comma_list bracket
  3. | PatId of name * init option
  4. | PatProp of property_name * tok * pattern
  5. | PatDots of tok * pattern
  6. | PatNest of pattern * init option
and class_decl = {
  1. c_tok : tok;
  2. c_name : name option;
  3. c_type_params : type_parameter comma_list angle option;
  4. c_extends : (tok * nominal_type) option;
  5. c_body : class_element list brace;
}
and class_element =
  1. | C_method of static_opt * func_decl
  2. | C_field of field_decl * sc
  3. | C_extrasemicolon of sc
and static_opt = tok option
and field_decl = {
  1. fld_static : static_opt;
  2. fld_name : property_name;
  3. fld_type : type_opt;
  4. fld_init : init option;
}
and interface_decl = {
  1. i_tok : tok;
  2. i_name : name;
  3. i_type_params : type_parameter comma_list angle option;
  4. i_type : type_;
}
and item =
  1. | St of stmt
  2. | FunDecl of func_decl
  3. | ClassDecl of class_decl
  4. | InterfaceDecl of interface_decl
  5. | ItemTodo of tok
and import =
  1. | ImportFrom of import_clause * (tok * module_path)
  2. | ImportEffect of module_path
and import_clause = import_default option * name_import option
and name_import =
  1. | ImportNamespace of tok * tok * name
  2. | ImportNames of import_name comma_list brace
  3. | ImportTypes of tok * import_name comma_list brace
and import_default = name
and import_name = name * (tok * name) option
and export =
  1. | ExportDecl of item
  2. | ExportDefaultDecl of tok * item
  3. | ExportDefaultExpr of tok * expr * sc
  4. | ExportNames of import_name comma_list brace * sc
  5. | ReExportNamespace of tok * tok * module_path * sc
  6. | ReExportNames of import_name comma_list brace * tok * module_path * sc
and module_item =
  1. | It of item
  2. | Import of tok * import * sc
  3. | Export of tok * export
and program = module_item list
type any =
  1. | Expr of expr
  2. | Stmt of stmt
  3. | Pattern of pattern
  4. | Item of item
  5. | Program of program
val unwrap : ('a * 'b) -> 'a
val unparen : ('a * 'b * 'c) -> 'b
val unbrace : ('a * 'b * 'c) -> 'b
val unbracket : ('a * 'b * 'c) -> 'b
val uncomma : ('a, 'b) Common.either list -> 'a list
val info_of_name : ('a * 'b) -> 'b
val fakeInfoAttach : PI.t -> PI.token_mutable
OCaml

Innovation. Community. Security.