diff options
author | Son Ho | 2023-01-07 16:47:33 +0100 |
---|---|---|
committer | Son HO | 2023-02-03 11:21:46 +0100 |
commit | f8b7206e0d92aa33812047c521a3c2278fdb6327 (patch) | |
tree | 2f7a37aa85200f5757d0c9fa9d9bd46ae6c6fcff /compiler/PureUtils.ml | |
parent | 9a94302823e07c4e8a50ea4e67c8f61e8827c23c (diff) |
Improve the heuristic to find pretty names for the variables in the loops
Diffstat (limited to '')
-rw-r--r-- | compiler/PureUtils.ml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/PureUtils.ml b/compiler/PureUtils.ml index a60bcd78..e86d2a78 100644 --- a/compiler/PureUtils.ml +++ b/compiler/PureUtils.ml @@ -57,6 +57,8 @@ let compute_primitive_value_ty (cv : primitive_value) : ty = | Char _ -> Char | String _ -> Str +let var_get_id (v : var) : VarId.id = v.id + let mk_typed_pattern_from_primitive_value (cv : primitive_value) : typed_pattern = let ty = compute_primitive_value_ty cv in @@ -73,6 +75,10 @@ let mk_tag (msg : string) (next_e : texpression) : texpression = let ty = next_e.ty in { e; ty } +let mk_mplace (var_id : E.VarId.id) (name : string option) + (projection : mprojection) : mplace = + { var_id; name; projection } + (** Type substitution *) let ty_substitute (tsubst : TypeVarId.id -> ty) (ty : ty) : ty = let obj = |