Remove half-baked 'opacity' layer qualifier.

This commit is contained in:
Graydon Hoare 2011-04-19 14:00:04 -07:00
parent b7d680b57d
commit 3d9cf15d0b
11 changed files with 4 additions and 69 deletions

View File

@ -678,7 +678,6 @@ The keywords are:
@tab @code{auto}
@item @code{state}
@tab @code{gc}
@tab @code{abs}
@tab @code{const}
@tab @code{thread}
@item @code{auth}

View File

@ -37,11 +37,6 @@ type layer =
| LAYER_gc
;;
type opacity =
OPA_transparent
| OPA_abstract
;;
type mutability =
MUT_mutable
| MUT_immutable
@ -720,22 +715,6 @@ and fmt_layer_qual
fmt_layer ff s;
if s <> LAYER_value then fmt ff " ";
and fmt_opacity
(ff:Format.formatter)
(opa:opacity)
: unit =
match opa with
OPA_transparent -> ()
| OPA_abstract -> fmt ff "abs"
and fmt_opacity_qual
(ff:Format.formatter)
(op:opacity)
: unit =
fmt_opacity ff op;
if op <> OPA_transparent then fmt ff " ";
and fmt_ty_fn
(ff:Format.formatter)
(ident_and_params:(ident * ty_param array) option)

View File

@ -609,8 +609,7 @@ and parse_stmts_including_none (ps:pstate) : Ast.stmt array =
spans ps stmts apos (Ast.STMT_join lval)
| STATE | GC
| ABS | NATIVE
| STATE | GC | NATIVE
| MOD | OBJ | TAG | TYPE | FN | USE ->
let items = ctxt "stmt: decl" parse_mod_item ps in
let bpos = lexpos ps in
@ -695,7 +694,6 @@ 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_layer ps in
let ident = Pexp.parse_ident ps in
let i = !iref in
@ -990,9 +988,8 @@ and parse_mod_item (ps:pstate)
match peek ps with
STATE | GC | ABS
STATE | GC
| TYPE | OBJ | TAG | FN | ITER ->
let _ = Pexp.parse_opacity ps in
let layer = Pexp.parse_layer ps in
begin
match peek ps with

View File

@ -95,8 +95,6 @@
("claim", CLAIM);
("prove", PROVE);
("abs", ABS);
("state", STATE);
("gc", GC);

View File

@ -140,11 +140,6 @@ and parse_optional_trailing_constrs (ps:pstate) : Ast.constrs =
COLON -> (bump ps; parse_constrs ps)
| _ -> [| |]
and parse_opacity (ps:pstate) : Ast.opacity =
match peek ps with
ABS -> bump ps; Ast.OPA_abstract
| _ -> Ast.OPA_transparent
and parse_layer (ps:pstate) : Ast.layer =
match peek ps with
STATE -> bump ps; Ast.LAYER_state

View File

@ -80,9 +80,6 @@ type token =
| CLAIM
| PROVE
(* Opacity keywords *)
| ABS
(* Layer keywords *)
| STATE
| GC
@ -243,9 +240,6 @@ let rec string_of_tok t =
| CLAIM -> "claim"
| PROVE -> "prove"
(* Opacity keywords *)
| ABS -> "abs"
(* Layer keywords *)
| STATE -> "state"
| GC -> "gc"

View File

@ -119,11 +119,6 @@ tag mutability {
maybe_mut;
}
tag opacity {
op_abstract;
op_transparent;
}
tag layer {
layer_value;
layer_state;

View File

@ -130,8 +130,6 @@ fn keyword_table() -> std.map.hashmap[str, token.token] {
keywords.insert("claim", token.CLAIM);
keywords.insert("prove", token.PROVE);
keywords.insert("abs", token.ABS);
keywords.insert("state", token.STATE);
keywords.insert("gc", token.GC);

View File

@ -1951,7 +1951,6 @@ fn parse_item_native_fn(parser p) -> @ast.native_item {
}
fn parse_native_item(parser p) -> @ast.native_item {
let ast.opacity opa = parse_opacity(p);
let ast.layer lyr = parse_layer(p);
alt (p.peek()) {
case (token.TYPE) {
@ -2106,18 +2105,6 @@ fn parse_item_tag(parser p) -> @ast.item {
ret @spanned(lo, hi, item);
}
fn parse_opacity(parser p) -> ast.opacity {
alt (p.peek()) {
case (token.ABS) {
p.bump();
ret ast.op_abstract;
}
case (_) {
ret ast.op_transparent;
}
}
fail;
}
fn parse_layer(parser p) -> ast.layer {
alt (p.peek()) {
@ -2167,7 +2154,6 @@ fn peeking_at_item(parser p) -> bool {
}
fn parse_item(parser p) -> @ast.item {
let ast.opacity opa = parse_opacity(p);
let ast.layer lyr = parse_layer(p);
alt (p.peek()) {

View File

@ -93,9 +93,6 @@ tag token {
CLAIM;
PROVE;
/* Opacity keywords */
ABS;
/* Layer keywords */
STATE;
GC;
@ -265,9 +262,6 @@ fn to_str(token t) -> str {
case (CLAIM) { ret "claim"; }
case (PROVE) { ret "prove"; }
/* Opacity keywords */
case (ABS) { ret "abs"; }
/* Layer keywords */
case (STATE) { ret "state"; }
case (GC) { ret "gc"; }

View File

@ -6,7 +6,7 @@
type hashfn[K] = fn(&K) -> uint;
type eqfn[K] = fn(&K, &K) -> bool;
abs state type hashmap[K, V] = state obj {
state type hashmap[K, V] = state obj {
fn size() -> uint;
fn insert(&K key, &V val) -> bool;
fn contains_key(&K key) -> bool;
@ -241,5 +241,5 @@ fn mk_hashmap[K, V](&hashfn[K] hasher, &eqfn[K] eqer) -> hashmap[K, V] {
// indent-tabs-mode: nil
// c-basic-offset: 4
// buffer-file-coding-system: utf-8-unix
// compile-command: "make -k -C .. 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
// End: