Remove the old serializers (needs snapshot)

This commit is contained in:
Erick Tryzelaar 2012-10-07 16:33:20 -07:00
parent 91b7a9a529
commit eb626e7119
21 changed files with 2265 additions and 2956 deletions

File diff suppressed because it is too large Load diff

View file

@ -214,120 +214,6 @@ fn expand_auto_deserialize(
}
}
priv impl ext_ctxt {
fn expr(span: span, node: ast::expr_) -> @ast::expr {
@{id: self.next_id(), callee_id: self.next_id(),
node: node, span: span}
}
fn path(span: span, strs: ~[ast::ident]) -> @ast::path {
@{span: span, global: false, idents: strs, rp: None, types: ~[]}
}
fn path_tps(span: span, strs: ~[ast::ident],
tps: ~[@ast::ty]) -> @ast::path {
@{span: span, global: false, idents: strs, rp: None, types: tps}
}
fn ty_path(span: span, strs: ~[ast::ident],
tps: ~[@ast::ty]) -> @ast::ty {
@{id: self.next_id(),
node: ast::ty_path(self.path_tps(span, strs, tps), self.next_id()),
span: span}
}
fn binder_pat(span: span, nm: ast::ident) -> @ast::pat {
let path = @{span: span, global: false, idents: ~[nm],
rp: None, types: ~[]};
@{id: self.next_id(),
node: ast::pat_ident(ast::bind_by_implicit_ref,
path,
None),
span: span}
}
fn stmt(expr: @ast::expr) -> @ast::stmt {
@{node: ast::stmt_semi(expr, self.next_id()),
span: expr.span}
}
fn lit_str(span: span, s: @~str) -> @ast::expr {
self.expr(
span,
ast::expr_vstore(
self.expr(
span,
ast::expr_lit(
@{node: ast::lit_str(s),
span: span})),
ast::expr_vstore_uniq))
}
fn lit_uint(span: span, i: uint) -> @ast::expr {
self.expr(
span,
ast::expr_lit(
@{node: ast::lit_uint(i as u64, ast::ty_u),
span: span}))
}
fn lambda(blk: ast::blk) -> @ast::expr {
let ext_cx = self;
let blk_e = self.expr(blk.span, ast::expr_block(blk));
#ast{ || $(blk_e) }
}
fn blk(span: span, stmts: ~[@ast::stmt]) -> ast::blk {
{node: {view_items: ~[],
stmts: stmts,
expr: None,
id: self.next_id(),
rules: ast::default_blk},
span: span}
}
fn expr_blk(expr: @ast::expr) -> ast::blk {
{node: {view_items: ~[],
stmts: ~[],
expr: Some(expr),
id: self.next_id(),
rules: ast::default_blk},
span: expr.span}
}
fn expr_path(span: span, strs: ~[ast::ident]) -> @ast::expr {
self.expr(span, ast::expr_path(self.path(span, strs)))
}
fn expr_var(span: span, var: ~str) -> @ast::expr {
self.expr_path(span, ~[self.ident_of(var)])
}
fn expr_field(
span: span,
expr: @ast::expr,
ident: ast::ident
) -> @ast::expr {
self.expr(span, ast::expr_field(expr, ident, ~[]))
}
fn expr_call(
span: span,
expr: @ast::expr,
args: ~[@ast::expr]
) -> @ast::expr {
self.expr(span, ast::expr_call(expr, args, false))
}
fn lambda_expr(expr: @ast::expr) -> @ast::expr {
self.lambda(self.expr_blk(expr))
}
fn lambda_stmts(span: span, stmts: ~[@ast::stmt]) -> @ast::expr {
self.lambda(self.blk(span, stmts))
}
}
fn mk_impl(
cx: ext_ctxt,
span: span,

View file

@ -81,8 +81,6 @@ fn syntax_expander_table() -> HashMap<~str, syntax_extension> {
builtin_item_tt(
ext::tt::macro_rules::add_new_extension));
syntax_expanders.insert(~"fmt", builtin(ext::fmt::expand_syntax_ext));
syntax_expanders.insert(~"auto_serialize",
item_decorator(ext::auto_serialize::expand));
syntax_expanders.insert(
~"auto_serialize2",
item_decorator(ext::auto_serialize2::expand_auto_serialize));
@ -143,16 +141,10 @@ fn syntax_expander_table() -> HashMap<~str, syntax_extension> {
syntax_expanders.insert(~"fmt", builtin(ext::fmt::expand_syntax_ext));
syntax_expanders.insert(
~"auto_serialize",
item_decorator(ext::auto_serialize2::expand_auto_serialize));
item_decorator(ext::auto_serialize::expand_auto_serialize));
syntax_expanders.insert(
~"auto_deserialize",
item_decorator(ext::auto_serialize2::expand_auto_deserialize));
syntax_expanders.insert(
~"auto_serialize2",
item_decorator(ext::auto_serialize2::expand_auto_serialize));
syntax_expanders.insert(
~"auto_deserialize2",
item_decorator(ext::auto_serialize2::expand_auto_deserialize));
item_decorator(ext::auto_serialize::expand_auto_deserialize));
syntax_expanders.insert(~"env", builtin(ext::env::expand_syntax_ext));
syntax_expanders.insert(~"concat_idents",
builtin(ext::concat_idents::expand_syntax_ext));