summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-01-12 02:57:27 +0100
committerGuillaume Seguin <guillaume@segu.in>2009-01-12 02:57:27 +0100
commit797daf453ae53466dfa56380e9b2f225d268f9d5 (patch)
tree1cf51bdb8400983706da09dbb4a219a359f142e1
parent68dd15729869c1accb5bca3214fbfe8cca3b49ba (diff)
downloadpetitcaml-797daf453ae53466dfa56380e9b2f225d268f9d5.tar.gz
petitcaml-797daf453ae53466dfa56380e9b2f225d268f9d5.tar.bz2
[petitcaml] Reindent ast.mli
-rw-r--r--ast.mli94
1 files changed, 50 insertions, 44 deletions
diff --git a/ast.mli b/ast.mli
index 814e1c7..f335fde 100644
--- a/ast.mli
+++ b/ast.mli
@@ -3,64 +3,70 @@ open Lexing
(* Types *)
type typ =
- | Tint
- | Tstring
- | Tbool
- | Tunit
- | Tarrow of typ * typ
- | Tproduct of typ list
- | Tlist of typ
- | Tvar of tvar
-and tvar =
- { id : int;
- mutable def : typ option }
+ | Tint
+ | Tstring
+ | Tbool
+ | Tunit
+ | Tarrow of typ * typ
+ | Tproduct of typ list
+ | Tlist of typ
+ | Tvar of tvar
+and tvar = { id : int;
+ mutable def : typ option }
(* AST *)
type ident = string
type func_name = string option
-type pos = { l : int ; c : int ; raw_c : int }
-type loc = { spos : pos ; epos : pos }
+type pos = { l : int ;
+ c : int ;
+ raw_c : int }
+type loc = { spos : pos ;
+ epos : pos }
type expr_loc = loc option
type expr_typ = typ option
-type binop = Add | Sub | Mul | Div | And | Or | Eq | Neq | Lt | Le | Gt | Ge
-type unop = Neg | Not
+type binop =
+ | OAdd | OSub | OMul | ODiv
+ | OAnd | OOr
+ | OEq | ONeq | OLt | OLe | OGt | OGe
+type unop =
+ | ONeg
+ | ONot
type const =
- | Cint of int
- | Cstring of string
- | Cbool of bool
- | Cunit
- | Cemptylist
+ | Cint of int
+ | Cstring of string
+ | Cbool of bool
+ | Cunit
+ | Cemptylist
type motif_raw =
- | Munderscore
- | Mident of string
- | Mtuple of motif list
-and motif = { m : motif_raw ;
- motif_loc : expr_loc ;
+ | Munderscore
+ | Mident of string
+ | Mtuple of motif list
+and motif = { m : motif_raw ;
+ motif_loc : expr_loc ;
mutable motif_t : expr_typ }
type expr_raw =
- | Econst of const
- | Eident of ident
- | Etuple of expr list
- | Ebinop of expr * binop * expr
- | Eunop of unop * expr
- | Eletin of motif * expr * expr
- | Efunc of func
- | Eif of expr * expr * expr
- | Elistcons of expr * expr
- | Ecall of expr * expr
- | Ematch of expr * expr * motif * motif * expr
- | Eclos of ident * ident list
-and expr = { e : expr_raw ;
- loc : expr_loc ;
+ | Econst of const
+ | Eident of ident
+ | Etuple of expr list
+ | Ebinop of expr * binop * expr
+ | Eunop of unop * expr
+ | Eletin of motif * expr * expr
+ | Efunc of func
+ | Eif of expr * expr * expr
+ | Elistcons of expr * expr
+ | Ecall of expr * expr
+ | Ematch of expr * expr * motif * motif * expr
+ | Eclos of ident * ident list
+and expr = { e : expr_raw ;
+ loc : expr_loc ;
mutable t : expr_typ }
-and func =
- { name : func_name ;
- recursive : bool ;
- arg : motif ;
- body : expr }
+and func = { name : func_name ;
+ recursive : bool ;
+ arg : motif ;
+ body : expr }