aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/parser.rs
diff options
context:
space:
mode:
authorMarijn Haverbeke <[email protected]>2011-03-28 20:46:31 +0200
committerGraydon Hoare <[email protected]>2011-03-31 14:41:40 +0000
commitf8393cc572db5a18b9412324a7501fadb48f9944 (patch)
tree9ed9d5ce650bc6685b26b7ecec0be14589fd3515 /src/comp/front/parser.rs
parentPreserve comments when pretty-printing. (diff)
downloadrust-f8393cc572db5a18b9412324a7501fadb48f9944.tar.xz
rust-f8393cc572db5a18b9412324a7501fadb48f9944.zip
Add effect field to ast.ty_fn.
Still not used, except by the pretty-printer.
Diffstat (limited to 'src/comp/front/parser.rs')
-rw-r--r--src/comp/front/parser.rs23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index 82f7712f..3ee73576 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -184,7 +184,7 @@ impure fn parse_str_lit_or_env_ident(parser p) -> ast.ident {
}
-impure fn parse_ty_fn(ast.proto proto, parser p,
+impure fn parse_ty_fn(ast.effect eff, ast.proto proto, parser p,
ast.span lo) -> ast.ty_ {
impure fn parse_fn_input_ty(parser p) -> rec(ast.mode mode, @ast.ty ty) {
auto mode;
@@ -228,7 +228,7 @@ impure fn parse_ty_fn(ast.proto proto, parser p,
output = @spanned(lo, inputs.span, ast.ty_nil);
}
- ret ast.ty_fn(proto, inputs.node, output);
+ ret ast.ty_fn(eff, proto, inputs.node, output);
}
impure fn parse_proto(parser p) -> ast.proto {
@@ -245,15 +245,14 @@ impure fn parse_ty_obj(parser p, &mutable ast.span hi) -> ast.ty_ {
impure fn parse_method_sig(parser p) -> ast.ty_method {
auto flo = p.get_span();
- // FIXME: do something with this, currently it's dropped on the floor.
let ast.effect eff = parse_effect(p);
let ast.proto proto = parse_proto(p);
auto ident = parse_ident(p);
- auto f = parse_ty_fn(proto, p, flo);
+ auto f = parse_ty_fn(eff, proto, p, flo);
expect(p, token.SEMI);
alt (f) {
- case (ast.ty_fn(?proto, ?inputs, ?output)) {
- ret rec(proto=proto, ident=ident,
+ case (ast.ty_fn(?eff, ?proto, ?inputs, ?output)) {
+ ret rec(effect=eff, proto=proto, ident=ident,
inputs=inputs, output=output);
}
}
@@ -342,9 +341,9 @@ impure fn parse_ty(parser p) -> @ast.ty {
auto hi = lo;
let ast.ty_ t;
- // FIXME: do something with these; currently they're
- // dropped on the floor.
+ // FIXME: make sure these are only used when valid
let ast.effect eff = parse_effect(p);
+ // FIXME: do something with this
let ast.layer lyr = parse_layer(p);
alt (p.peek()) {
@@ -412,9 +411,9 @@ impure fn parse_ty(parser p) -> @ast.ty {
case (token.FN) {
auto flo = p.get_span();
p.bump();
- t = parse_ty_fn(ast.proto_fn, p, flo);
+ t = parse_ty_fn(eff, ast.proto_fn, p, flo);
alt (t) {
- case (ast.ty_fn(_, _, ?out)) {
+ case (ast.ty_fn(_, _, _, ?out)) {
hi = out.span;
}
}
@@ -423,9 +422,9 @@ impure fn parse_ty(parser p) -> @ast.ty {
case (token.ITER) {
auto flo = p.get_span();
p.bump();
- t = parse_ty_fn(ast.proto_iter, p, flo);
+ t = parse_ty_fn(eff, ast.proto_iter, p, flo);
alt (t) {
- case (ast.ty_fn(_, _, ?out)) {
+ case (ast.ty_fn(_, _, _, ?out)) {
hi = out.span;
}
}