package pfff

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tok = Parse_info.t
type 'a wrap = 'a * tok
type 'a bracket = tok * 'a * tok
type ident = string wrap
type qualified_ident = ident list
type type_ =
  1. | TName of qualified_ident
  2. | TPtr of tok * type_
  3. | TArray of expr * type_
  4. | TSlice of type_
  5. | TArrayEllipsis of tok * type_
  6. | TFunc of func_type
  7. | TMap of tok * type_ * type_
  8. | TChan of tok * chan_dir * type_
  9. | TStruct of tok * struct_field list bracket
  10. | TInterface of tok * interface_field list bracket
and chan_dir =
  1. | TSend
  2. | TRecv
  3. | TBidirectional
and func_type = {
  1. fparams : parameter_binding list;
  2. fresults : parameter_binding list;
}
and parameter_binding =
  1. | ParamClassic of parameter
  2. | ParamEllipsis of tok
and parameter = {
  1. pname : ident option;
  2. ptype : type_;
  3. pdots : tok option;
}
and struct_field = struct_field_kind * tag option
and struct_field_kind =
  1. | Field of ident * type_
  2. | EmbeddedField of tok option * qualified_ident
and tag = string wrap
and interface_field =
  1. | Method of ident * func_type
  2. | EmbeddedInterface of qualified_ident
and expr_or_type = (expr, type_) Common.either
and expr =
  1. | BasicLit of literal
  2. | CompositeLit of type_ * init list bracket
  3. | Id of ident * Ast_generic.resolved_name option ref
  4. | Selector of expr * tok * ident
  5. | Index of expr * index
  6. | Slice of expr * expr option * expr option * expr option
  7. | Call of call_expr
  8. | Cast of type_ * expr
  9. | Deref of tok * expr
  10. | Ref of tok * expr
  11. | Receive of tok * expr
  12. | Unary of Ast_generic.arithmetic_operator wrap * expr
  13. | Binary of expr * Ast_generic.arithmetic_operator wrap * expr
  14. | TypeAssert of expr * type_
  15. | TypeSwitchExpr of expr * tok
  16. | Ellipsis of tok
  17. | FuncLit of function_
  18. | ParenType of type_
  19. | Send of expr * tok * expr
and literal =
  1. | Int of string wrap
  2. | Float of string wrap
  3. | Imag of string wrap
  4. | Rune of string wrap
  5. | String of string wrap
and index = expr
and arguments = argument list
and argument =
  1. | Arg of expr
  2. | ArgType of type_
  3. | ArgDots of expr * tok
and init =
  1. | InitExpr of expr
  2. | InitKeyValue of init * tok * init
  3. | InitBraces of init list bracket
and constant_expr = expr
and stmt =
  1. | DeclStmts of decl list
  2. | Block of stmt list
  3. | Empty
  4. | SimpleStmt of simple
  5. | If of tok * simple option * expr * stmt * stmt option
  6. | Switch of tok * simple option * simple option * case_clause list
  7. | Select of tok * comm_clause list
  8. | For of tok * simple option * expr option * simple option * stmt
  9. | Range of tok * (expr list * tok) option * tok * expr * stmt
  10. | Return of tok * expr list option
  11. | Break of tok * ident option
  12. | Continue of tok * ident option
  13. | Goto of tok * ident
  14. | Fallthrough of tok
  15. | Label of ident * stmt
  16. | Go of tok * call_expr
  17. | Defer of tok * call_expr
and case_clause = case_kind * stmt
and case_kind =
  1. | CaseExprs of tok * expr_or_type list
  2. | CaseAssign of tok * expr_or_type list * tok * expr
  3. | CaseDefault of tok
and comm_clause = case_clause
and call_expr = expr * arguments
and simple =
  1. | ExprStmt of expr
  2. | Assign of expr list * tok * expr list
  3. | AssignOp of expr * Ast_generic.arithmetic_operator wrap * expr
  4. | IncDec of expr * Ast_generic.incr_decr wrap * Ast_generic.prefix_postfix
  5. | DShortVars of expr list * tok * expr list
and decl =
  1. | DConst of ident * type_ option * constant_expr option
  2. | DVar of ident * type_ option * expr option
  3. | DTypeAlias of ident * tok * type_
  4. | DTypeDef of ident * type_
and function_ = func_type * stmt
type top_decl =
  1. | DFunc of ident * function_
  2. | DMethod of ident * parameter * function_
  3. | D of decl
type import = {
  1. i_tok : tok;
  2. i_path : string wrap;
  3. i_kind : import_kind;
}
and import_kind =
  1. | ImportOrig
  2. | ImportNamed of ident
  3. | ImportDot of tok
type program = {
  1. package : tok * ident;
  2. imports : import list;
  3. decls : top_decl list;
}
type item =
  1. | ITop of top_decl
  2. | IImport of import
  3. | IStmt of stmt
type any =
  1. | E of expr
  2. | S of stmt
  3. | T of type_
  4. | Decl of decl
  5. | I of import
  6. | P of program
  7. | Ident of ident
  8. | Ss of stmt list
  9. | Item of item
  10. | Items of item list
val stmt1 : stmt list -> stmt
val item1 : item list -> any
val str_of_id : ('a * 'b) -> 'a