Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
type keyword_attribute = [
| `Static
| `Volatile
| `Extern
| `Public
| `Private
| `Protected
| `Abstract
| `Final
| `Override
| `RecordClass
| `AnnotationClass
| `EnumClass
| `SealedClass
| `Var
| `Let
| `Mutable
| `Const
| `Optional
| `NotNull
| `Recursive
| `MutuallyRecursive
| `Generator
| `Async
| `Inline
| `Ctor
| `Dtor
| `Getter
| `Setter
| `Unsafe
| `DefaultImpl
| `Lazy
| `Throws
| `Rethrows
| `OtherKeyword of string
]
type operator = [
| `Plus
| `Minus
| `Mult
| `Div
| `Mod
| `Pow
| `FloorDiv
| `MatMult
| `LSL
| `LSR
| `ASR
| `BitOr
| `BitXor
| `BitAnd
| `BitNot
| `BitClear
| `And
| `Or
| `Xor
| `Not
| `Eq
| `NotEq
| `PhysEq
| `NotPhysEq
| `Lt
| `LtE
| `Gt
| `GtE
| `Cmp
| `Concat
| `Append
| `RegexpMatch
| `NotMatch
| `Range
| `RangeInclusive
| `NotNullPostfix
| `Length
| `Elvis
| `Nullish
| `In
| `NotIn
| `Is
| `NotIs
| `Background
| `Pipe
]
type special = [
| `This
| `Super
| `Self
| `Parent
| `Eval
| `Typeof
| `Instanceof
| `Sizeof
| `Defined
| `ConcatString of concat_string_kind
| `EncodedString of string
| `InterpolatedElement
| `Spread
| `HashSplat
| `ForOf
| `Op of operator
| `IncrDecr of incr_decr * prefix_postfix
| `Require
| `OtherSpecial of string
]
type tok = token
type sc = tok
type 'a wrap_ = 'a * tok
type ident = string wrap_
type dotted_ident = ident list
type label = ident
type literal = [
| `Bool of bool wrap_
| `Int of int option wrap_
| `Float of float option wrap_
| `Char of string wrap_
| `String of string wrap_
| `Regexp of string wrap_ bracket * string wrap_ option
| `Atom of tok * string wrap_
| `Unit of tok
| `Null of tok
| `Undefined of tok
| `Imag of string wrap_
| `Ratio of string wrap_
]
type resolved_name_kind = [
| `Global
| `Local
| `Param
| `ImportedEntity of dotted_ident
| `ImportedModule of module_name
| `OtherResolvedNameKind of string
]
type resolved_name = resolved_name_kind * sid
type todo_kind = string wrap_
and any = [
| `E of expr
| `S of stmt
| `T of type_
| `P of pattern
| `At of attribute
| `Fld of field
| `Ar of argument
| `Pa of parameter
| `Ta of type_argument
| `Tp of type_parameter
| `Ce of catch_exn
| `Cs of case
| `ForOrIfComp of for_or_if_comp
| `En of entity
| `I of ident
| `Modn of module_name
| `Di of dotted_ident
| `Lbli of label_ident
| `Str of string wrap_
| `Tk of tok
| `TodoK of todo_kind
| `Anys of any list
]
and catch_exn = [
| `CatchPattern of pattern
| `CatchParam of parameter_classic
| `OtherCatch of todo_kind * any list
]
and class_definition = {
ckind : class_kind wrap_;
cextends : class_parent list;
cimplements : type_ list;
cmixins : type_ list;
cparams : parameters;
cbody : field list bracket;
}
and comprehension = expr * for_or_if_comp list
and definition = entity * definition_kind
and definition_kind = [
| `FuncDef of function_definition
| `VarDef of variable_definition
| `ClassDef of class_definition
| `EnumEntryDef of enum_entry_definition
| `TypeDef of type_definition
| `ModuleDef of module_definition
| `MacroDef of macro_definition
| `Signature of type_
| `UseOuterDecl of tok
| `OtherDef of todo_kind * any list
]
and directive = [
| `ImportFrom of tok * module_name * (ident * alias option) list
| `ImportAs of tok * module_name * alias option
| `ImportAll of tok * module_name * tok
| `Package of tok * dotted_ident
| `PackageEnd of tok
| `Pragma of ident * any list
| `OtherDirective of todo_kind * any list
]
and expr = [
| `L of literal
| `Container of container_operator * expr list bracket
| `Comprehension of container_operator * comprehension bracket
| `Record of field list bracket
| `Constructor of name * expr list bracket
| `N of name
| `IdSpecial of special wrap_
| `Call of expr * arguments
| `New of tok * type_ * arguments
| `Xml of xml
| `Assign of expr * tok * expr
| `AssignOp of expr * operator wrap_ * expr
| `LetPattern of pattern * expr
| `DotAccess of expr * tok * field_name
| `ArrayAccess of expr * expr bracket
| `SliceAccess of expr * (expr option * expr option * expr option) bracket
| `Lambda of function_definition
| `AnonClass of class_definition
| `Conditional of expr * expr * expr
| `Yield of tok * expr option * bool
| `Await of tok * expr
| `Cast of type_ * expr
| `Seq of expr list
| `Ref of tok * expr
| `DeRef of tok * expr
| `Ellipsis of tok
| `ParenExpr of expr bracket
| `StmtExpr of stmt
| `OtherExpr of todo_kind * any list
]
and for_header = [
| `ForClassic of for_var_or_expr list * expr option * expr option
| `ForEach of for_each
| `MultiForEach of multi_for_each list
| `ForIn of for_var_or_expr list * expr list
]
and function_definition = {
fkind : function_kind wrap_;
fparams : parameters;
frettype : type_ option;
fbody : function_body;
}
and id_info = {
id_resolved : resolved_name option;
id_type : type_ option;
id_svalue : svalue option;
}
and item = stmt
and module_definition_kind = [
| `ModuleAlias of dotted_ident
| `ModuleStruct of dotted_ident option * item list
| `OtherModule of todo_kind * any list
]
and parameter = [
| `ParamClassic of parameter_classic
| `ParamPattern of pattern
| `ParamRest of tok * parameter_classic
| `ParamHashSplat of tok * parameter_classic
| `OtherParam of todo_kind * any list
]
and parameters = parameter list
and pattern = [
| `PatLiteral of literal
| `PatConstructor of name * pattern list
| `PatRecord of (dotted_ident * pattern) list bracket
| `PatId of ident * id_info
| `PatTuple of pattern list bracket
| `PatList of pattern list bracket
| `PatKeyVal of pattern * pattern
| `PatUnderscore of tok
| `PatDisj of pattern * pattern
| `PatTyped of pattern * type_
| `PatWhen of pattern * expr
| `PatAs of pattern * (ident * id_info)
| `PatType of type_
| `OtherPat of todo_kind * any list
]
and qualified_info = {
name_last : ident * type_arguments option;
name_middle : qualifier option;
name_top : tok option;
name_info : id_info;
}
and stmt = [
| `ExprStmt of expr * sc
| `Block of stmt list bracket
| `If of tok * condition * stmt * stmt option
| `While of tok * condition * stmt
| `Return of tok * expr option * sc
| `DoWhile of tok * stmt * expr
| `For of tok * for_header * stmt
| `Switch of tok * condition option * case_and_body list
| `Continue of tok * label_ident * sc
| `Break of tok * label_ident * sc
| `Label of label * stmt
| `Goto of tok * label
| `Throw of tok * expr * sc
| `Try of tok * stmt * catch list * finally option
| `WithUsingResource of tok * stmt list * stmt
| `Assert of tok * arguments * sc
| `DefStmt of definition
| `DirectiveStmt of directive
| `OtherStmt of todo_kind * any list
]
and type_ = [
| `TyN of name
| `TyApply of type_ * type_arguments
| `TyFun of parameter list * type_
| `TyArray of expr option bracket * type_
| `TyTuple of type_ list bracket
| `TyVar of ident
| `TyAny of tok
| `TyPointer of tok * type_
| `TyRef of tok * type_
| `TyQuestion of type_ * tok
| `TyRest of tok * type_
| `TyAnd of type_ * tok * type_
| `TyOr of type_ * tok * type_
| `TyRecordAnon of class_kind wrap_ * field list bracket
| `TyExpr of expr
| `OtherType of todo_kind * any list
]
and type_arguments = type_argument list bracket
and type_parameters = type_parameter list
and xml_attr_value = expr
type program = item list