diff options
| author | Michael Sullivan <sully@msully.net> | 2012-07-14 12:45:45 -0700 |
|---|---|---|
| committer | Michael Sullivan <sully@msully.net> | 2012-07-14 12:45:52 -0700 |
| commit | 7b2f4755f3de2af6a8038ca960801853b86eb7ad (patch) | |
| tree | b0f8cd1798dad2e4c6bc819cad203e8fb92f9964 /src/libsyntax | |
| parent | d884085f43f87213e3045e474c39908d6555153a (diff) | |
| download | rust-7b2f4755f3de2af6a8038ca960801853b86eb7ad.tar.gz rust-7b2f4755f3de2af6a8038ca960801853b86eb7ad.zip | |
Get rid of ast::ty_vstore, which was only used for fixed length.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/auto_serialize.rs | 19 | ||||
| -rw-r--r-- | src/libsyntax/fold.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 19 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 16 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 2 |
6 files changed, 21 insertions, 39 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 30535b45529..6cf6818ba40 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -503,7 +503,7 @@ enum ty_ { ty_tup(~[@ty]), ty_path(@path, node_id), ty_constr(@ty, ~[@ty_constr]), - ty_vstore(@ty, vstore), + ty_fixed_length(@ty, option<uint>), ty_mac(mac), // ty_infer means the type should be inferred instead of it having been // specified. This should only appear at the "top level" of a type and not diff --git a/src/libsyntax/ext/auto_serialize.rs b/src/libsyntax/ext/auto_serialize.rs index ac2829643be..98671234249 100644 --- a/src/libsyntax/ext/auto_serialize.rs +++ b/src/libsyntax/ext/auto_serialize.rs @@ -497,15 +497,9 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map, }] } - // For unique vstores, just pass through to the underlying vec or str - ast::ty_vstore(ty, ast::vstore_uniq) { - ser_ty(cx, tps, ty, s, v) - } - - ast::ty_vstore(_, _) { - cx.span_unimpl(ty.span, ~"serialization for vstore types"); + ast::ty_fixed_length(_, _) { + cx.span_unimpl(ty.span, ~"serialization for fixed length types"); } - } } @@ -720,13 +714,8 @@ fn deser_ty(cx: ext_ctxt, tps: deser_tps_map, #ast{ std::serialization::read_to_vec($(d), $(l)) } } - // For unique vstores, just pass through to the underlying vec or str - ast::ty_vstore(ty, ast::vstore_uniq) { - deser_ty(cx, tps, ty, d) - } - - ast::ty_vstore(_, _) { - cx.span_unimpl(ty.span, ~"deserialization for vstore types"); + ast::ty_fixed_length(_, _) { + cx.span_unimpl(ty.span, ~"deserialization for fixed length types"); } } } diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index f5edb96f5e1..e3bb29cdb92 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -506,7 +506,7 @@ fn noop_fold_ty(t: ty_, fld: ast_fold) -> ty_ { ty_path(path, id) {ty_path(fld.fold_path(path), fld.new_id(id))} ty_constr(ty, constrs) {ty_constr(fld.fold_ty(ty), vec::map(constrs, |x| fld.fold_ty_constr(x)))} - ty_vstore(t, vs) {ty_vstore(fld.fold_ty(t), vs)} + ty_fixed_length(t, vs) {ty_fixed_length(fld.fold_ty(t), vs)} ty_mac(mac) {ty_mac(fold_mac(mac))} } } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index a19ea2d25e9..b67fd88ab61 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -49,7 +49,8 @@ import ast::{_mod, add, alt_check, alt_exhaustive, arg, arm, attribute, tt_delim, tt_dotdotdot, tt_flat, tt_interpolate, ty, ty_, ty_bot, ty_box, ty_constr, ty_constr_, ty_constr_arg, ty_field, ty_fn, ty_infer, ty_mac, ty_method, ty_nil, ty_param, ty_path, ty_ptr, - ty_rec, ty_rptr, ty_tup, ty_u32, ty_uniq, ty_vec, ty_vstore, + ty_rec, ty_rptr, ty_tup, ty_u32, ty_uniq, ty_vec, + ty_fixed_length, unchecked_blk, uniq, unsafe_blk, unsafe_fn, variant, view_item, view_item_, view_item_export, view_item_import, view_item_use, view_path, view_path_glob, view_path_list, view_path_simple, @@ -554,11 +555,11 @@ class parser { let sp = mk_sp(lo, self.last_span.hi); ret @{id: self.get_id(), - node: alt self.maybe_parse_vstore() { - // Consider a vstore suffix like /@ or /~ + node: alt self.maybe_parse_fixed_vstore() { + // Consider a fixed vstore suffix (/N or /_) none { t } some(v) { - ty_vstore(@{id: self.get_id(), node:t, span: sp}, v) + ty_fixed_length(@{id: self.get_id(), node:t, span: sp}, v) } }, span: sp} } @@ -650,15 +651,15 @@ class parser { } } - fn maybe_parse_vstore() -> option<vstore> { + fn maybe_parse_fixed_vstore() -> option<option<uint>> { if self.token == token::BINOP(token::SLASH) { self.bump(); alt copy self.token { token::UNDERSCORE { - self.bump(); some(vstore_fixed(none)) + self.bump(); some(none) } token::LIT_INT_UNSUFFIXED(i) if i >= 0i64 { - self.bump(); some(vstore_fixed(some(i as uint))) + self.bump(); some(some(i as uint)) } _ { none @@ -1029,11 +1030,11 @@ class parser { alt ex { expr_lit(@{node: lit_str(_), span: _}) | expr_vec(_, _) { - alt self.maybe_parse_vstore() { + alt self.maybe_parse_fixed_vstore() { none { } some(v) { hi = self.span.hi; - ex = expr_vstore(self.mk_expr(lo, hi, ex), v); + ex = expr_vstore(self.mk_expr(lo, hi, ex), vstore_fixed(v)); } } } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 29da51ec083..a0ad2647cba 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -378,18 +378,10 @@ fn print_type_ex(s: ps, &&ty: @ast::ty, print_colons: bool) { space(s.s); word(s.s, constrs_str(cs, ty_constr_to_str)); } - ast::ty_vstore(t, v) { - alt v { - ast::vstore_fixed(_) { - print_type(s, t); - word(s.s, ~"/"); - print_vstore(s, v); - } - _ { - print_vstore(s, v); - print_type(s, t); - } - } + ast::ty_fixed_length(t, v) { + print_type(s, t); + word(s.s, ~"/"); + print_vstore(s, ast::vstore_fixed(v)); } ast::ty_mac(_) { fail ~"print_type doesn't know how to print a ty_mac"; diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 6d3c2ba74bc..86ba214f23c 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -200,7 +200,7 @@ fn visit_ty<E>(t: @ty, e: E, v: vt<E>) { v.visit_ty(decl.output, e, v); } ty_path(p, _) { visit_path(p, e, v); } - ty_vstore(t, _) { + ty_fixed_length(t, _) { v.visit_ty(t, e, v); } ty_constr(t, cs) { |
