From b0b4b3122a4af7bf9b361c8f646da4a120e7ba38 Mon Sep 17 00:00:00 2001 From: John Clements Date: Fri, 11 Jul 2014 21:22:11 -0700 Subject: refactor Method definition to make space for macros This change propagates to many locations, but because of the Macro Exterminator (or, more properly, the invariant that it protects), macro invocations can't occur downstream of expansion. This means that in librustc and librustdoc, extracting the desired field can simply assume that it can't be a macro invocation. Functions in ast_util abstract over this check. --- src/libsyntax/parse/parser.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 84db2bc5a22..cc3a7dc095b 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1249,16 +1249,10 @@ impl<'a> Parser<'a> { p.parse_inner_attrs_and_block(); let attrs = attrs.append(inner_attrs.as_slice()); Provided(box(GC) ast::Method { - ident: ident, attrs: attrs, - generics: generics, - explicit_self: explicit_self, - fn_style: style, - decl: d, - body: body, id: ast::DUMMY_NODE_ID, span: mk_sp(lo, hi), - vis: vis, + node: ast::MethDecl(ident, generics, explicit_self, style, d, body, vis) }) } @@ -4049,16 +4043,10 @@ impl<'a> Parser<'a> { let hi = body.span.hi; let attrs = attrs.append(inner_attrs.as_slice()); box(GC) ast::Method { - ident: ident, attrs: attrs, - generics: generics, - explicit_self: explicit_self, - fn_style: fn_style, - decl: decl, - body: body, id: ast::DUMMY_NODE_ID, span: mk_sp(lo, hi), - vis: visa, + node: ast::MethDecl(ident, generics, explicit_self, fn_style, decl, body, visa), } } -- cgit 1.4.1-3-g733a5