Permalink
Browse files

[cleanup] Opa TyPrivate: Removed TyPrivate stuff in stdlib (OPA- 666).

  • Loading branch information...
1 parent bd42f97 commit b746c3d185f7d33882597cb602665d02ff9b022e @fpessaux fpessaux committed Jul 4, 2011
@@ -192,7 +192,6 @@ OpaDocXhtml = {{
r = with_link(TyName_ident, <>{aux_tuple(TyName_ident)}</>)
<>{r}({aux_list(TyName_args)})</>
| {TyAbstract} -> <>external</>
- | {~TyPrivate_impl ...} -> <>private({aux(TyPrivate_impl)})</>
| {~TyForall_quant ~TyForall_body} ->
<>&forall;
{concat_greek(TyForall_quant.types
@@ -94,7 +94,6 @@ OpaApiFile = {{
table = associate_id_val(TyName_ident, val, table)
aux_list(table, TyName_args)
| {TyAbstract} -> table
- | {TyPrivate_impl=_ ...} -> table
| { TyForall_quant=_ TyForall_body=body } -> aux(table, body)
end
aux_sugar(table, ty:Api.ty) =
@@ -187,8 +187,7 @@ compare_front(ty) =
do cache_ty.add(key,cmp)
cmp
- {TyForall_quant = _; TyForall_body = impl}
- {TyPrivate_impl = impl; TyPrivate_ghost = _} -> compare_front(impl)
+ {TyForall_quant = _; TyForall_body = impl} -> compare_front(impl)
_ -> compare_prematch_ty(ty)
@private
@@ -342,8 +341,7 @@ compare_front(ty) =
end
/* Indirection cases ***********************/
- {TyForall_quant = _; TyForall_body = impl}
- {TyPrivate_impl = impl; TyPrivate_ghost = _} -> aux(impl,preenv)
+ {TyForall_quant = _; TyForall_body = impl} -> aux(impl,preenv)
/* Maybe error case if called *************/
{TyRecord_row = _; TyRecord_rowvar = _}
@@ -406,7 +404,6 @@ equal_ty(ty1:OpaType.ty,ty2:OpaType.ty) =
/* Indirection cases ***********************/
{TyForall_quant = _; TyForall_body = impl1} -> match ty2 {TyForall_quant = _; TyForall_body = impl2} -> equal_ty(impl1,impl2) _ -> false end
- {TyPrivate_impl = impl1; TyPrivate_ghost = _}-> match ty2 {TyPrivate_impl = impl2; TyPrivate_ghost = _}-> equal_ty(impl1,impl2) _ -> false end
{TyVar = _} -> match ty2 {TyVar = _} -> true _ -> false end // ??
View
@@ -105,9 +105,6 @@ OpaTsc = {{
{TyName_args = aux_list(TyName_args);
TyName_ident = TyName_ident}
| {TyAbstract} -> t
- | {~TyPrivate_impl ~TyPrivate_ghost} ->
- {TyPrivate_impl = aux(TyPrivate_impl);
- TyPrivate_ghost = aux(TyPrivate_ghost)}//TODO: inst here, really?
| {~TyForall_quant ~TyForall_body} ->
//TODO : Remove quantifier if all instantiate in body??
{TyForall_quant = TyForall_quant;
@@ -194,7 +191,6 @@ type OpaType.ty =
{TyArrow_params : list(OpaType.ty); TyArrow_res : OpaType.ty} /
{TyName_args : list(OpaType.ty); TyName_ident : OpaType.ty_ident} /
{TyAbstract} /
- {TyPrivate_impl : OpaType.ty; TyPrivate_ghost : OpaType.ty} /
{TyForall_quant : OpaTsc.quantifier; TyForall_body : OpaType.ty} /
{TyRecord_row : OpaType.fields} / /* INVARIANT: the lists are sorted by the field names lexixographically
* (and the shorter record is the smaller) */
@@ -295,7 +291,6 @@ OpaType = {{
| {~TySum_col ~TySum_colvar} -> "\{TySum_col = {aux_fields_list(TySum_col)}; TySum_colvar = {TySum_colvar}}"
| {~TyName_args ~TyName_ident} -> "\{TyName_args = {aux_list(TyName_args)}; TyName_ident = {TyName_ident}}"
| {TyAbstract} -> "\{TyAbstract}"
- | {~TyPrivate_impl ~TyPrivate_ghost} -> "\{TyPrivate_impl = {aux(TyPrivate_impl)}; TyPrivate_ghost = {aux(TyPrivate_ghost)}}"
| {~TyForall_quant ~TyForall_body} ->
"\{TyForall_quant = {aux_quant(TyForall_quant)}; TyForall_body = {aux(TyForall_body)}}"
@@ -343,7 +338,6 @@ OpaType = {{
| {~TySum_col TySum_colvar = _} -> to_pretty_lfields(TySum_col) ^ " / __"
| {~TyName_args ~TyName_ident} -> TyName_ident ^ aux_list(TyName_args)
| {TyAbstract} -> "abstract"
- | {~TyPrivate_impl ...} -> "private(" ^ aux(TyPrivate_impl) ^ ")"
| {~TyForall_quant ~TyForall_body} ->
"forall(" ^ aux_quant(TyForall_quant) ^ ")." ^ aux(TyForall_body)
and aux_quant(~{types rows cols}:OpaTsc.quantifier) =
@@ -383,16 +377,14 @@ OpaType = {{
OpaTsc.instantiate_type_only(args, OpaTsc.get_unsafe(ident))
/**
- * Get implementation of the given type. i.e. traverse [TyName] and
- * [TyPrivate].
+ * Get implementation of the given type. i.e. traverse [TyName].
*
* Note : If that should be returns {TyAbstract} instead returns the
* named type that encapsulate {TyAbstract} (if it possible...)
*/
implementation(ty : OpaType.ty) =
rec aux(ty : OpaType.ty) =
match ty with
- | {TyPrivate_impl = impl; TyPrivate_ghost = _} -> aux(impl)
| {TyName_ident = ident; TyName_args = args} ->
match type_of_name(ident, args) with
| {TyAbstract} -> ty
View
@@ -189,9 +189,6 @@ OpaValue = {{
aux_rec(value, OpaType.fields_of_fields_list(value, col).f1, text)
/* Encapsuled types ***********************/
- | {TyPrivate_impl = impl; TyPrivate_ghost = _} ->
- "private(" ++ aux(value, impl, text) ++ ")"
-
| {TyName_args = args; TyName_ident = ident} ->
todo_magic_container(
%%BslValue.MagicContainer.to_string_get%%,
@@ -250,7 +247,6 @@ OpaValue = {{
end
/* Encapsuled types ***********************/
- | {TyPrivate_impl = impl; TyPrivate_ghost = _} -> aux(a, b, impl)
| {TyName_args = args; TyName_ident = ident} ->
match %%BslValue.MagicContainer.compare_get%%(ident) with
| {none} -> aux(a, b, OpaType.type_of_name(ident, args))
@@ -121,7 +121,6 @@ import stdlib.core.{web.core, js}
end
/* Encapsulated types ***********************/
- | {TyPrivate_impl = impl; TyPrivate_ghost = _} -> aux(value, impl): RPC.Json.js_code
| {TyName_args = args; TyName_ident = ident} ->
implem = OpaType.type_of_name(ident,args)
aux(value, implem): RPC.Json.js_code
@@ -305,7 +305,6 @@ type OpaSerialize.options = {
aux_abstract_client(value, WebUtils.is_client())
/* Encapsulated types ***********************/
- | {TyPrivate_impl = impl; TyPrivate_ghost = _} -> aux(value, impl)
| {TyName_args = args; TyName_ident = ident} ->
match %%BslValue.MagicContainer.serializer_get%%(ident) with
| {none} -> aux(value, OpaType.type_of_name(ident, args))
@@ -659,8 +658,6 @@ type OpaSerialize.options = {
ident, args, (ty, x -> aux(x, ty)),
aux(_, OpaType.type_of_name(ident, args)),
json)
- | (_, {TyPrivate_impl = impl; TyPrivate_ghost = _}) ->
- aux(json, impl)
| (_, {TyForall_quant = _; TyForall_body = body}) ->
aux(json, body)

0 comments on commit b746c3d

Please sign in to comment.