diff options
| author | Marijn Haverbeke <[email protected]> | 2011-05-12 10:51:13 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <[email protected]> | 2011-05-12 10:51:13 +0200 |
| commit | 2b36e40c58a4b153da593e4da73ba45647b811de (patch) | |
| tree | c2cad9d5166622366057eb7c59b3e9dc0221e717 /src/comp/front | |
| parent | Properly lex block comments followed by EOF (diff) | |
| download | rust-2b36e40c58a4b153da593e4da73ba45647b811de.tar.xz rust-2b36e40c58a4b153da593e4da73ba45647b811de.zip | |
Ensure ann tags are actually kept around during typechecking
This way, the tag assigned by the parser stays with the node.
I realize ann replacing is probably going away real soon, but
I needed this now for moving the resolve defs out of the AST.
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 8cfffc39..af3ded19 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -24,11 +24,19 @@ type ty_param = ident; // Annotations added during successive passes. tag ann { ann_none(uint); - ann_type(middle.ty.t, + ann_type(uint, + middle.ty.t, Option.t[vec[middle.ty.t]], /* ty param substs */ Option.t[@ts_ann]); /* pre- and postcondition for typestate */ } +fn ann_tag(&ann a) -> uint { + ret alt (a) { + case (ann_none(?t)) { t } + case (ann_type(?t, _, _, _)) { t } + }; +} + tag def { def_fn(def_id); def_obj(def_id); |