aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-10-08 12:26:34 -0700
committerPatrick Walton <[email protected]>2010-10-08 12:26:34 -0700
commite3758fe321725bec4707e1b7d4fff333ba915905 (patch)
tree4d9c60203378443b34cdce5fff0b9783d674b46d /src/comp/front
parentAdd a little code to resolve, to check that the fold interface works. (diff)
downloadrust-e3758fe321725bec4707e1b7d4fff333ba915905.tar.xz
rust-e3758fe321725bec4707e1b7d4fff333ba915905.zip
rustc: Make functions output a type, not a slot
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/ast.rs2
-rw-r--r--src/comp/front/parser.rs7
2 files changed, 4 insertions, 5 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs
index 422fd039..0b0f571c 100644
--- a/src/comp/front/ast.rs
+++ b/src/comp/front/ast.rs
@@ -129,7 +129,7 @@ type slot = rec(@ty ty, mode mode, option[slot_id] id);
type input = rec(slot slot, ident ident);
type _fn = rec(vec[input] inputs,
- slot output,
+ ty output,
block body);
type _mod = hashmap[ident,@item];
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index 4eb303ed..8e848afb 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -603,13 +603,12 @@ io fn parse_fn(parser p) -> tup(ast.ident, @ast.item) {
some(token.COMMA),
pf, p);
- let ast.slot output;
+ let ast.ty output;
if (p.peek() == token.RARROW) {
p.bump();
- output = rec(ty=parse_ty(p), mode=ast.val, id=none[ast.slot_id]);
+ output = *parse_ty(p);
} else {
- output = rec(ty=@spanned(lo, inputs.span, ast.ty_nil),
- mode=ast.val, id=none[ast.slot_id]);
+ output = spanned(lo, inputs.span, ast.ty_nil);
}
auto body = parse_block(p);