diff options
Diffstat (limited to 'src/boot/fe')
| -rw-r--r-- | src/boot/fe/ast.ml | 50 | ||||
| -rw-r--r-- | src/boot/fe/fuzz.ml | 2 | ||||
| -rw-r--r-- | src/boot/fe/item.ml | 28 | ||||
| -rw-r--r-- | src/boot/fe/pexp.ml | 16 | ||||
| -rw-r--r-- | src/boot/fe/token.ml | 4 |
5 files changed, 50 insertions, 50 deletions
diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml index ce9f9cc4..5e814af3 100644 --- a/src/boot/fe/ast.ml +++ b/src/boot/fe/ast.ml @@ -34,10 +34,10 @@ type effect = | EFF_unsafe ;; -type stratum = - STRAT_value - | STRAT_state - | STRAT_gc +type layer = + LAYER_value + | LAYER_state + | LAYER_gc ;; type opacity = @@ -94,7 +94,7 @@ and ty = | TY_task | TY_native of opaque_id - | TY_param of (ty_param_idx * stratum) + | TY_param of (ty_param_idx * layer) | TY_named of name | TY_type @@ -181,7 +181,7 @@ and ty_fn = (ty_sig * ty_fn_aux) and ty_obj_header = (slot array * constrs) -and ty_obj = (stratum * ((ident,ty_fn) Hashtbl.t)) +and ty_obj = (layer * ((ident,ty_fn) Hashtbl.t)) and check_calls = (lval * (atom array)) array @@ -434,7 +434,7 @@ and fn = and obj = { obj_state: header_slots; - obj_stratum: stratum; + obj_layer: layer; obj_constrs: constrs; obj_fns: (ident,fn identified) Hashtbl.t; obj_drop: block option; @@ -449,10 +449,10 @@ and obj = * even if it's a type that's bound by a quantifier in its environment. *) -and ty_param = ident * (ty_param_idx * stratum) +and ty_param = ident * (ty_param_idx * layer) and mod_item' = - MOD_ITEM_type of (stratum * ty) + MOD_ITEM_type of (layer * ty) | MOD_ITEM_tag of (header_slots * opaque_id * int) | MOD_ITEM_mod of (mod_view * mod_items) | MOD_ITEM_fn of fn @@ -723,21 +723,21 @@ and fmt_effect_qual fmt_effect ff e; if e <> EFF_pure then fmt ff " "; -and fmt_stratum +and fmt_layer (ff:Format.formatter) - (strat:stratum) + (la:layer) : unit = - match strat with - STRAT_value -> () - | STRAT_state -> fmt ff "state" - | STRAT_gc -> fmt ff "gc" + match la with + LAYER_value -> () + | LAYER_state -> fmt ff "state" + | LAYER_gc -> fmt ff "gc" -and fmt_stratum_qual +and fmt_layer_qual (ff:Format.formatter) - (s:stratum) + (s:layer) : unit = - fmt_stratum ff s; - if s <> STRAT_value then fmt ff " "; + fmt_layer ff s; + if s <> LAYER_value then fmt ff " "; and fmt_opacity (ff:Format.formatter) @@ -810,7 +810,7 @@ and fmt_ty (ff:Format.formatter) (t:ty) : unit = fmt_ident_tys ff entries; fmt ff "@]" - | TY_param (i, s) -> (fmt_stratum_qual ff s; + | TY_param (i, s) -> (fmt_layer_qual ff s; fmt ff "<p#%d>" i) | TY_native oid -> fmt ff "<native#%d>" (int_of_opaque oid) | TY_named n -> fmt_name ff n @@ -833,9 +833,9 @@ and fmt_ty (ff:Format.formatter) (t:ty) : unit = | TY_constrained ctrd -> fmt_constrained ff ctrd - | TY_obj (stratum, fns) -> + | TY_obj (layer, fns) -> fmt_obox ff; - fmt_stratum_qual ff stratum; + fmt_layer_qual ff layer; fmt ff "obj "; fmt_obr ff; Hashtbl.iter @@ -1629,7 +1629,7 @@ and fmt_slice (ff:Format.formatter) (slice:slice) : unit = and fmt_decl_param (ff:Format.formatter) (param:ty_param) : unit = let (ident, (i, s)) = param in - fmt_stratum_qual ff s; + fmt_layer_qual ff s; fmt_ident ff ident; fmt ff "=<p#%d>" i @@ -1683,7 +1683,7 @@ and fmt_obj (obj:obj) : unit = fmt_obox ff; - fmt_stratum_qual ff obj.obj_stratum; + fmt_layer_qual ff obj.obj_layer; fmt ff "obj "; fmt_ident_and_params ff id params; fmt_header_slots ff obj.obj_state; @@ -1720,7 +1720,7 @@ and fmt_mod_item (ff:Format.formatter) (id:ident) (item:mod_item) : unit = begin match item.node.decl_item with MOD_ITEM_type (s, ty) -> - fmt_stratum_qual ff s; + fmt_layer_qual ff s; fmt ff "type "; fmt_ident_and_params ff id params; fmt ff " = "; diff --git a/src/boot/fe/fuzz.ml b/src/boot/fe/fuzz.ml index 734ef06c..2c465be4 100644 --- a/src/boot/fe/fuzz.ml +++ b/src/boot/fe/fuzz.ml @@ -104,7 +104,7 @@ let rec generate_mod_item (mis:mod_items) (cx:ctxt) : unit = match Random.int 2 with 0 -> let ty = generate_ty cx in - let st = Ast.STRAT_value in + let st = Ast.LAYER_value in decl (MOD_ITEM_type (st, ty)) | _ -> let mis' = Hashtbl.create 0 in diff --git a/src/boot/fe/item.ml b/src/boot/fe/item.ml index fc144439..6cee8796 100644 --- a/src/boot/fe/item.ml +++ b/src/boot/fe/item.ml @@ -692,7 +692,7 @@ and parse_stmts_including_none (ps:pstate) : Ast.stmt array = and parse_ty_param (iref:int ref) (ps:pstate) : Ast.ty_param identified = let apos = lexpos ps in let _ = Pexp.parse_opacity ps in - let s = Pexp.parse_stratum ps in + let s = Pexp.parse_layer ps in let ident = Pexp.parse_ident ps in let i = !iref in let bpos = lexpos ps in @@ -842,7 +842,7 @@ and parse_optional_meta_pat (ps:pstate) (ident:Ast.ident) : Ast.meta_pat = and parse_obj_item (ps:pstate) (apos:pos) - (stratum:Ast.stratum) + (layer:Ast.layer) : (Ast.ident * Ast.mod_item) = expect ps OBJ; let (ident, params) = parse_ident_and_params ps "obj" in @@ -871,7 +871,7 @@ and parse_obj_item expect ps RBRACE; let bpos = lexpos ps in let obj = { Ast.obj_state = state; - Ast.obj_stratum = stratum; + Ast.obj_layer = layer; Ast.obj_constrs = constrs; Ast.obj_fns = fns; Ast.obj_drop = !drop } @@ -883,7 +883,7 @@ and parse_obj_item and parse_tag_item (ps:pstate) (apos:pos) - (stratum:Ast.stratum) + (layer:Ast.layer) : (Ast.ident * Ast.mod_item) array = expect ps TAG; let (ident, params) = parse_ident_and_params ps "tag" in @@ -945,14 +945,14 @@ and parse_tag_item let ty_item = (ident, span ps apos bpos - (decl params (Ast.MOD_ITEM_type (stratum, ty)))) + (decl params (Ast.MOD_ITEM_type (layer, ty)))) in Array.append [| ty_item |] constructors and parse_type_item (ps:pstate) (apos:pos) - (stratum:Ast.stratum) + (layer:Ast.layer) : (Ast.ident * Ast.mod_item) = expect ps TYPE; let (ident, params) = parse_ident_and_params ps "type" in @@ -960,7 +960,7 @@ and parse_type_item let ty = ctxt "mod type item: ty" Pexp.parse_ty ps in let _ = expect ps SEMI in let bpos = lexpos ps in - let item = Ast.MOD_ITEM_type (stratum, ty) in + let item = Ast.MOD_ITEM_type (layer, ty) in (ident, span ps apos bpos (decl params item)) and parse_mod_item (ps:pstate) @@ -992,25 +992,25 @@ and parse_mod_item (ps:pstate) STATE | GC | IMPURE | UNSAFE | ABS | TYPE | OBJ | TAG | FN | ITER -> let _ = Pexp.parse_opacity ps in - let stratum = Pexp.parse_stratum ps in + let layer = Pexp.parse_layer ps in let effect = Pexp.parse_effect ps in begin match peek ps with OBJ -> if effect <> Ast.EFF_pure then raise (err "effect specified for obj" ps); - [| parse_obj_item ps apos stratum |] + [| parse_obj_item ps apos layer |] | TAG -> if effect <> Ast.EFF_pure then raise (err "effect specified for tag" ps); - parse_tag_item ps apos stratum + parse_tag_item ps apos layer | TYPE -> if effect <> Ast.EFF_pure then raise (err "effect specified for type" ps); - [| parse_type_item ps apos stratum |] + [| parse_type_item ps apos layer |] | _ -> - if stratum <> Ast.STRAT_value - then raise (err "stratum specified for fn or iter" ps); + if layer <> Ast.LAYER_value + then raise (err "layer specified for fn or iter" ps); let is_iter = (peek ps) = ITER in bump ps; let (ident, params) = parse_ident_and_params ps "fn" in @@ -1159,7 +1159,7 @@ and parse_native_mod_item_from_signature (ps:pstate) expect ps SEMI; let bpos = lexpos ps in [| (ident, span ps apos bpos - (decl params (Ast.MOD_ITEM_type (Ast.STRAT_value, t)))) |] + (decl params (Ast.MOD_ITEM_type (Ast.LAYER_value, t)))) |] | _ -> raise (unexpected ps) diff --git a/src/boot/fe/pexp.ml b/src/boot/fe/pexp.ml index 1b26431d..2f9c2bad 100644 --- a/src/boot/fe/pexp.ml +++ b/src/boot/fe/pexp.ml @@ -145,11 +145,11 @@ and parse_opacity (ps:pstate) : Ast.opacity = ABS -> bump ps; Ast.OPA_abstract | _ -> Ast.OPA_transparent -and parse_stratum (ps:pstate) : Ast.stratum = +and parse_layer (ps:pstate) : Ast.layer = match peek ps with - STATE -> bump ps; Ast.STRAT_state - | GC -> bump ps; Ast.STRAT_gc - | _ -> Ast.STRAT_value + STATE -> bump ps; Ast.LAYER_state + | GC -> bump ps; Ast.LAYER_gc + | _ -> Ast.LAYER_value and parse_effect (ps:pstate) : Ast.effect = match peek ps with @@ -274,7 +274,7 @@ and parse_atomic_ty (ps:pstate) : Ast.ty = Ast.TY_mach m | STATE | GC | IMPURE | UNSAFE | OBJ | FN | ITER -> - let stratum = parse_stratum ps in + let layer = parse_layer ps in let effect = parse_effect ps in begin match peek ps with @@ -295,11 +295,11 @@ and parse_atomic_ty (ps:pstate) : Ast.ty = in ignore (bracketed_zero_or_more LBRACE RBRACE None parse_method ps); - Ast.TY_obj (stratum, methods) + Ast.TY_obj (layer, methods) | FN | ITER -> - if stratum <> Ast.STRAT_value - then raise (err "stratum specified for fn or iter" ps); + if layer <> Ast.LAYER_value + then raise (err "layer specified for fn or iter" ps); Ast.TY_fn (fst (parse_ty_fn effect ps)) | _ -> raise (unexpected ps) end diff --git a/src/boot/fe/token.ml b/src/boot/fe/token.ml index 6c2282de..7467d4e6 100644 --- a/src/boot/fe/token.ml +++ b/src/boot/fe/token.ml @@ -83,7 +83,7 @@ type token = (* Opacity keywords *) | ABS - (* Stratum keywords *) + (* Layer keywords *) | STATE | GC @@ -246,7 +246,7 @@ let rec string_of_tok t = (* Opacity keywords *) | ABS -> "abs" - (* Stratum keywords *) + (* Layer keywords *) | STATE -> "state" | GC -> "gc" |