mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-09 22:16:10 +03:00
Removed duplicate comments
This commit is contained in:
parent
3776362c67
commit
44a937630d
@ -30,8 +30,6 @@ module EnumConstructor : Uid.Id with type info = Uid.MarkedString.info =
|
||||
|
||||
module EnumMap : Map.S with type key = EnumName.t = Map.Make (EnumName)
|
||||
|
||||
(** {1 Abstract syntax tree} *)
|
||||
|
||||
type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration
|
||||
|
||||
type typ =
|
||||
@ -56,12 +54,7 @@ type lit =
|
||||
| LDate of date
|
||||
| LDuration of duration
|
||||
|
||||
type op_kind =
|
||||
| KInt
|
||||
| KRat
|
||||
| KMoney
|
||||
| KDate
|
||||
| KDuration (** All ops don't have a Kdate and KDuration *)
|
||||
type op_kind = KInt | KRat | KMoney | KDate | KDuration
|
||||
|
||||
type ternop = Fold
|
||||
|
||||
@ -117,8 +110,6 @@ type enum_ctx = (EnumConstructor.t * typ Pos.marked) list EnumMap.t
|
||||
|
||||
type decl_ctx = { ctx_enums : enum_ctx; ctx_structs : struct_ctx }
|
||||
|
||||
(** {1 Variable helpers} *)
|
||||
|
||||
module Var = struct
|
||||
type t = expr Bindlib.var
|
||||
|
||||
|
@ -121,8 +121,6 @@ type program = {
|
||||
program_structs : Scopelang.Ast.struct_ctx;
|
||||
}
|
||||
|
||||
(** {1 Helpers} *)
|
||||
|
||||
let free_variables (def : rule RuleMap.t) : Pos.t ScopeDefMap.t =
|
||||
let add_locs (acc : Pos.t ScopeDefMap.t) (locs : Scopelang.Ast.LocationSet.t) :
|
||||
Pos.t ScopeDefMap.t =
|
||||
|
@ -15,13 +15,6 @@
|
||||
open Utils
|
||||
module D = Dcalc.Ast
|
||||
|
||||
(** Abstract syntax tree for the lambda calculus *)
|
||||
|
||||
(** {1 Abstract syntax tree} *)
|
||||
|
||||
(** The expressions use the {{:https://lepigre.fr/ocaml-bindlib/} Bindlib} library, based on
|
||||
higher-order abstract syntax*)
|
||||
|
||||
type lit =
|
||||
| LBool of bool
|
||||
| LInt of Z.t
|
||||
@ -53,8 +46,6 @@ type expr =
|
||||
| ERaise of except
|
||||
| ECatch of expr Pos.marked * except * expr Pos.marked
|
||||
|
||||
(** {1 Variable helpers} *)
|
||||
|
||||
module Var = struct
|
||||
type t = expr Bindlib.var
|
||||
|
||||
|
@ -12,12 +12,7 @@
|
||||
or implied. See the License for the specific language governing permissions and limitations under
|
||||
the License. *)
|
||||
|
||||
(** Abstract syntax tree of the scope language *)
|
||||
|
||||
open Utils
|
||||
|
||||
(** {1 Identifiers} *)
|
||||
|
||||
module ScopeName = Dcalc.Ast.ScopeName
|
||||
|
||||
module ScopeNameSet : Set.S with type elt = ScopeName.t = Set.Make (ScopeName)
|
||||
@ -66,8 +61,6 @@ module LocationSet : Set.S with type elt = location Pos.marked = Set.Make (struc
|
||||
| SubScopeVar _, ScopeVar _ -> 1
|
||||
end)
|
||||
|
||||
(** {1 Abstract syntax tree} *)
|
||||
|
||||
type typ =
|
||||
| TLit of Dcalc.Ast.typ_lit
|
||||
| TStruct of StructName.t
|
||||
@ -76,8 +69,6 @@ type typ =
|
||||
| TArray of typ
|
||||
| TAny
|
||||
|
||||
(** The expressions use the {{:https://lepigre.fr/ocaml-bindlib/} Bindlib} library, based on
|
||||
higher-order abstract syntax*)
|
||||
type expr =
|
||||
| ELocation of location
|
||||
| EVar of expr Bindlib.var Pos.marked
|
||||
@ -146,8 +137,6 @@ type program = {
|
||||
program_structs : struct_ctx;
|
||||
}
|
||||
|
||||
(** {1 Variable helpers} *)
|
||||
|
||||
module Var = struct
|
||||
type t = expr Bindlib.var
|
||||
|
||||
|
@ -14,21 +14,17 @@
|
||||
|
||||
[@@@ocaml.warning "-7"]
|
||||
|
||||
(** Abstract syntax tree built by the Catala parser *)
|
||||
|
||||
open Utils
|
||||
|
||||
type constructor = (string[@opaque])
|
||||
[@@deriving
|
||||
visitors { variety = "map"; name = "constructor_map"; nude = true },
|
||||
visitors { variety = "iter"; name = "constructor_iter"; nude = true }]
|
||||
(** Constructors are CamelCase *)
|
||||
|
||||
type ident = (string[@opaque])
|
||||
[@@deriving
|
||||
visitors { variety = "map"; name = "ident_map"; nude = true },
|
||||
visitors { variety = "iter"; name = "ident_iter"; nude = true }]
|
||||
(** Idents are snake_case *)
|
||||
|
||||
type qident = ident Pos.marked list
|
||||
[@@deriving
|
||||
@ -150,12 +146,7 @@ type match_case_pattern =
|
||||
name = "match_case_pattern_iter";
|
||||
}]
|
||||
|
||||
type op_kind =
|
||||
| KInt (** No suffix *)
|
||||
| KDec (** Suffix: [.] *)
|
||||
| KMoney (** Suffix: [$] *)
|
||||
| KDate (** Suffix: [@] *)
|
||||
| KDuration (** Suffix: [^] *)
|
||||
type op_kind = KInt | KDec | KMoney | KDate | KDuration
|
||||
[@@deriving
|
||||
visitors { variety = "map"; name = "op_kind_map"; nude = true },
|
||||
visitors { variety = "iter"; name = "op_kind_iter"; nude = true }]
|
||||
@ -235,8 +226,8 @@ type literal =
|
||||
type aggregate_func =
|
||||
| AggregateSum of primitive_typ
|
||||
| AggregateCount
|
||||
| AggregateExtremum of bool (* true if max *) * primitive_typ * expression Pos.marked
|
||||
| AggregateArgExtremum of bool (* true if max *) * primitive_typ * expression Pos.marked
|
||||
| AggregateExtremum of bool * primitive_typ * expression Pos.marked
|
||||
| AggregateArgExtremum of bool * primitive_typ * expression Pos.marked
|
||||
|
||||
and collection_op = Exists | Forall | Aggregate of aggregate_func | Map | Filter
|
||||
|
||||
@ -266,7 +257,6 @@ and expression =
|
||||
| ArrayLit of expression Pos.marked list
|
||||
| Ident of ident
|
||||
| Dotted of expression Pos.marked * constructor Pos.marked option * ident Pos.marked
|
||||
(** Dotted is for both struct field projection and sub-scope variables *)
|
||||
[@@deriving
|
||||
visitors
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user