diff options
| author | Rafael Ávila de Espíndola <[email protected]> | 2011-02-04 11:10:04 -0500 |
|---|---|---|
| committer | Rafael Ávila de Espíndola <[email protected]> | 2011-02-04 11:10:04 -0500 |
| commit | 57bb9d809bb029caf7b38042a433153bb965e1fb (patch) | |
| tree | 46b7b717cf6e93779b048721278e242416300a94 /src/comp/front/ast.rs | |
| parent | Factor the parsing of "type foo" into parse_type_decl. (diff) | |
| download | rust-57bb9d809bb029caf7b38042a433153bb965e1fb.tar.xz rust-57bb9d809bb029caf7b38042a433153bb965e1fb.zip | |
Parse function declarations.
Diffstat (limited to 'src/comp/front/ast.rs')
| -rw-r--r-- | src/comp/front/ast.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 7b22e700..1220d6ab 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -201,10 +201,11 @@ tag ty_ { } type arg = rec(mode mode, @ty ty, ident ident, def_id id); -type _fn = rec(effect effect, +type fn_decl = rec(effect effect, + vec[arg] inputs, + @ty output); +type _fn = rec(fn_decl decl, bool is_iter, - vec[arg] inputs, - @ty output, block body); @@ -254,6 +255,7 @@ tag item_ { type native_item = spanned[native_item_]; tag native_item_ { native_item_ty(ident, def_id); + native_item_fn(ident, fn_decl, vec[ty_param], def_id); } fn index_view_item(mod_index index, @view_item it) { @@ -304,6 +306,9 @@ fn index_native_item(native_mod_index index, @native_item it) { case (ast.native_item_ty(?id, _)) { index.insert(id, it); } + case (ast.native_item_fn(?id, _, _, _)) { + index.insert(id, it); + } } } |