1
Fork 0

Introduce ast::proto_bare

Issue #1022
This commit is contained in:
Brian Anderson 2011-10-10 13:15:47 -07:00
parent 9c46cc58cb
commit b277039325
5 changed files with 13 additions and 3 deletions

View file

@ -197,6 +197,7 @@ fn enc_proto(w: io::writer, proto: proto) {
proto_iter. { w.write_char('W'); }
proto_fn. { w.write_char('F'); }
proto_block. { w.write_char('B'); }
proto_bare. { w.write_char('R'); }
}
}

View file

@ -478,7 +478,7 @@ mod write {
// has iter type and block has block type. This may end up changing.
fn proto_to_ty_proto(proto: ast::proto) -> ast::proto {
ret alt proto {
ast::proto_iter. | ast::proto_block. { proto }
ast::proto_iter. | ast::proto_block. | ast::proto_bare. { proto }
_ { ast::proto_fn }
};
}

View file

@ -102,7 +102,15 @@ tag kind { kind_pinned; kind_shared; kind_unique; }
tag _auth { auth_unsafe; }
tag proto { proto_iter; proto_fn; proto_block; proto_closure; }
tag proto {
proto_iter;
proto_fn;
proto_block;
proto_closure;
// Functions without an environment. Eventually, this will
// merge with proto_fn.
proto_bare;
}
tag binop {
add;

View file

@ -2129,7 +2129,7 @@ fn parse_auth(p: parser) -> ast::_auth {
fn parse_fn_proto(p: parser) -> ast::proto {
if p.peek() == token::POUND {
p.bump();
ast::proto_fn
ast::proto_bare
} else {
ast::proto_fn
}

View file

@ -1643,6 +1643,7 @@ fn proto_to_str(p: ast::proto) -> str {
ast::proto_iter. { "iter" }
ast::proto_block. { "block" }
ast::proto_closure. { "lambda" }
ast::proto_bare. { "fn#" }
};
}