package diffast-langs-python-parsing

  1. Overview
  2. Docs
module Astloc = Langs_common.Astloc
module Ast_base = Langs_common.Ast_base
module Loc : sig ... end
type loc = Loc.t
type name = loc * string
type dottedname = name list
type comment = {
  1. c_loc : Loc.t;
  2. c_comment : string;
}
val make_comment : Loc.t -> string -> comment
type fileinput =
  1. | Fileinput of loc * statement list
and testlist = {
  1. list : expr list;
  2. comma : bool;
  3. mutable yield : bool;
}
and statement = {
  1. stmt_desc : statement_desc;
  2. stmt_loc : loc;
}
and statement_desc =
  1. | Ssimple of simplestmt list
  2. | Sasync of statement
  3. | Sif of expr * suite * (loc * expr * suite) list * (loc * suite) option
  4. | Swhile of expr * suite * (loc * suite) option
  5. | Sfor of target list * expr list * suite * (loc * suite) option
  6. | Stry of suite * (except * suite) list * (loc * suite) option * (loc * suite) option
  7. | Stryfin of suite * loc * suite
  8. | Swith of (expr * target option) list * suite
  9. | Sasync_funcdef of decorator list * name * parameters * expr option * suite
  10. | Sfuncdef of decorator list * name * parameters * expr option * suite
  11. | Sclassdef of decorator list * name * arglist * suite
  12. | Smatch of subject_expr * case_block list
  13. | Serror
  14. | Smarker of string
and simplestmt = {
  1. sstmt_desc : simplestmt_desc;
  2. sstmt_loc : loc;
}
and simplestmt_desc =
  1. | SSexpr of expr list
  2. | SSassign of testlist list * testlist
  3. | SSannassign of target list * loc * expr * testlist option
  4. | SSaugassign of target list * augop * testlist
  5. | SSprint of expr list
  6. | SSprintchevron of expr * expr list
  7. | SSdel of target list
  8. | SSpass
  9. | SSbreak
  10. | SScontinue
  11. | SSreturn of expr list
  12. | SSraise
  13. | SSraise1 of expr
  14. | SSraise2 of expr * expr
  15. | SSraise3 of expr * expr * expr
  16. | SSraisefrom of expr * expr
  17. | SSyield of expr list
  18. | SSimport of dottedname_as_name list
  19. | SSfrom of dots option * dottedname option * name_as_name list
  20. | SSglobal of name list
  21. | SSnonlocal of name list
  22. | SSexec of expr
  23. | SSexec2 of expr * expr
  24. | SSexec3 of expr * expr * expr
  25. | SSassert of expr
  26. | SSassert2 of expr * expr
  27. | SSerror
and dottedname_as_name = dottedname * name option
and name_as_name = name * name option
and except =
  1. | EX of loc
  2. | EX1 of loc * expr
  3. | EX2 of loc * expr * target
and suite = loc * statement list
and dots = loc * int
and parameters = loc * vararg list
and vararg =
  1. | VAarg of fpdef * expr option
  2. | VAargs of loc * name option * expr option
  3. | VAkwargs of loc * name * expr option
  4. | VAsep of loc
and fpdef =
  1. | Fname of name
  2. | Flist of loc * fpdef list
  3. | Ftyped of loc * name * expr
and decorator = loc * dottedname * arglist
and expr = {
  1. expr_desc : expr_desc;
  2. expr_loc : loc;
}
and expr_desc =
  1. | Eprimary of primary
  2. | Epower of primary * expr
  3. | Ebop of expr * bop * expr
  4. | Euop of uop * expr
  5. | Elambda of parameters * expr
  6. | Econd of expr * expr * expr
  7. | Estar of expr
  8. | Enamed of expr * expr
  9. | Efrom of expr
  10. | Earg of expr * expr
  11. | Eerror
and primary = {
  1. prim_desc : primary_desc;
  2. prim_loc : loc;
}
and primary_desc =
  1. | Pname of name
  2. | Pliteral of literal
  3. | Pexpr of expr
  4. | Pparen of expr
  5. | Ptuple of expr list
  6. | Pyield of expr list
  7. | PcompT of expr * compfor
  8. | PcompL of expr * compfor
  9. | Plist of expr list
  10. | Plistnull
  11. | Pdictorset of dictorsetmaker
  12. | Pdictnull
  13. | Pstrconv of expr list
  14. | Pattrref of primary * name
  15. | Psubscript of primary * expr list
  16. | Pslice of primary * sliceitem list
  17. | Pcall of primary * arglist
  18. | Pawait of primary
  19. | Pellipsis
and trailer =
  1. | TRattrref of name
  2. | TRsubscript of expr list
  3. | TRslice of sliceitem list
  4. | TRcall of arglist
and literal =
  1. | Linteger of string
  2. | Llonginteger of string
  3. | Lfloatnumber of string
  4. | Limagnumber of string
  5. | Lstring of pystring list
  6. | Lnone
  7. | Ltrue
  8. | Lfalse
and pystring =
  1. | PSlong of loc * string
  2. | PSshort of loc * string
and target = expr
and listfor = loc * expr list * expr list * listiter option
and listif = loc * expr * listiter option
and listiter =
  1. | LIfor of listfor
  2. | LIif of listif
and dictorsetmaker =
  1. | DSMdict of dictelem list
  2. | DSMdictC of dictelem * compfor
  3. | DSMset of expr list
  4. | DSMsetC of expr * compfor
and dictelem = {
  1. delem_desc : dictelem_desc;
  2. delem_loc : loc;
}
and dictelem_desc =
  1. | DEkeyValue of expr * expr
  2. | DEstarStar of expr
and sliceitem =
  1. | SIexpr of expr
  2. | SI2 of loc * expr option * expr option
  3. | SI3 of loc * expr option * expr option * expr option
and arglist = loc * argument list
and argument =
  1. | Aarg of loc * expr * expr option
  2. | Acomp of loc * expr * compfor
  3. | Aassign of loc * expr * expr
  4. | Aargs of loc * expr
  5. | Akwargs of loc * expr
and compiter =
  1. | Cfor of compfor
  2. | Cif of compif
and compif = loc * expr * compiter option
and compfor = loc * (expr list * expr * compiter option) * bool
and augop =
  1. | AaddEq
  2. | AsubEq
  3. | AmulEq
  4. | AdivEq
  5. | AmodEq
  6. | AandEq
  7. | AorEq
  8. | AxorEq
  9. | AshiftLEq
  10. | AshiftREq
  11. | ApowEq
  12. | AfdivEq
and bop =
  1. | Bmul
  2. | Bdiv
  3. | Bfdiv
  4. | Bmod
  5. | Badd
  6. | Bsub
  7. | BshiftL
  8. | BshiftR
  9. | Beq
  10. | Bneq
  11. | Blt
  12. | Bgt
  13. | Ble
  14. | Bge
  15. | BbitAnd
  16. | BbitOr
  17. | BbitXor
  18. | Band
  19. | Bor
  20. | Bis
  21. | BisNot
  22. | Bin
  23. | BnotIn
and uop =
  1. | Upositive
  2. | Unegative
  3. | Ucomplement
  4. | Unot
and subject_expr =
  1. | SEstar of loc * expr * expr list
  2. | SEnamed of loc * expr
and guard = loc * expr
and complex_number =
  1. | CNplus of loc * literal_expr * string
  2. | CNminus of loc * literal_expr * string
and literal_expr =
  1. | LEsigned of loc * literal
  2. | LEsignedMinus of loc * literal
  3. | LEcmplxPlus of loc * literal_expr * string
  4. | LEcmplxMinus of loc * literal_expr * string
  5. | LEstrings of loc * pystring list
  6. | LEnone of loc
  7. | LEtrue of loc
  8. | LEfalse of loc
and key =
  1. | Kliteral of loc * literal_expr
  2. | Kattr of loc * name list
and pattern =
  1. | PAas of loc * pattern * pattern
  2. | PAor of loc * pattern list
  3. | PAcapture of name
  4. | PAliteral of literal_expr
  5. | PAwildcard of loc
  6. | PAvalue of loc * name list
  7. | PAgroup of loc * pattern
  8. | PAseqB of loc * pattern option
  9. | PAseqP of loc * pattern option
  10. | PAseqOpen of loc * pattern * pattern option
  11. | PAseqMaybe of loc * pattern list
  12. | PAstar of loc * pattern
  13. | PAdblStar of loc * pattern
  14. | PAmap of loc * pattern list * pattern option
  15. | PAkeyValue of loc * key * pattern
  16. | PAkeyword of loc * name * pattern
  17. | PAclass of loc * name list * pattern list * pattern list
and case_block = loc * pattern * guard option * suite
class c : fileinput -> object ... end
OCaml

Innovation. Community. Security.