diff options
Diffstat (limited to 'src/comp/front/ast.rs')
| -rw-r--r-- | src/comp/front/ast.rs | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 4fbc4f01..f4bfc7a2 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -55,6 +55,18 @@ tag mutability { imm; } +tag layer { + layer_value; + layer_state; + layer_gc; +} + +tag effect { + eff_pure; + eff_impure; + eff_unsafe; +} + tag binop { add; sub; @@ -85,6 +97,11 @@ tag unop { neg; } +tag mode { + val; + alias; +} + type stmt = spanned[stmt_]; tag stmt_ { stmt_decl(@decl); @@ -146,7 +163,9 @@ tag lit_ { // NB: If you change this, you'll probably want to change the corresponding // type structure in middle/typeck.rs as well. + type ty_field = rec(ident ident, @ty ty); +type ty_arg = rec(mode mode, @ty ty); type ty = spanned[ty_]; tag ty_ { ty_nil; @@ -160,18 +179,14 @@ tag ty_ { ty_vec(@ty); ty_tup(vec[@ty]); ty_rec(vec[ty_field]); - ty_fn(vec[rec(mode mode, @ty ty)], @ty); // TODO: effect + ty_fn(vec[ty_arg], @ty); // TODO: effect ty_path(path, option.t[def]); ty_mutable(@ty); } -tag mode { - val; - alias; -} - type arg = rec(mode mode, @ty ty, ident ident, def_id id); -type _fn = rec(vec[arg] inputs, +type _fn = rec(effect effect, + vec[arg] inputs, @ty output, block body); |