diff options
| author | Kang Seonghoon <public+git@mearie.org> | 2014-04-27 05:05:45 +0900 |
|---|---|---|
| committer | Kang Seonghoon <public+git@mearie.org> | 2014-04-27 14:52:30 +0900 |
| commit | dee21a67b802ba9d8a0fac11369cbcd53552a216 (patch) | |
| tree | 7ac97ed73d4e5aab30fdaa5411ef8f802982e6cc /src/libsyntax/ext | |
| parent | a692e9b1234ff6573b0cfbc39394d9222eb38f81 (diff) | |
| download | rust-dee21a67b802ba9d8a0fac11369cbcd53552a216.tar.gz rust-dee21a67b802ba9d8a0fac11369cbcd53552a216.zip | |
syntax: `Mod` records the span for inner contents.
this is useful when the module item and module contents are defined from different files (like rustdoc). in most cases the original span for the module item would be used; in other cases, the span for module contents is available separately at the `inner` field.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/build.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 1a160cb33aa..7e084ac263d 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -220,7 +220,7 @@ pub trait AstBuilder { generics: Generics) -> @ast::Item; fn item_struct(&self, span: Span, name: Ident, struct_def: ast::StructDef) -> @ast::Item; - fn item_mod(&self, span: Span, + fn item_mod(&self, span: Span, inner_span: Span, name: Ident, attrs: Vec<ast::Attribute> , vi: Vec<ast::ViewItem> , items: Vec<@ast::Item> ) -> @ast::Item; @@ -898,7 +898,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { self.item(span, name, Vec::new(), ast::ItemStruct(@struct_def, generics)) } - fn item_mod(&self, span: Span, name: Ident, + fn item_mod(&self, span: Span, inner_span: Span, name: Ident, attrs: Vec<ast::Attribute> , vi: Vec<ast::ViewItem> , items: Vec<@ast::Item> ) -> @ast::Item { @@ -907,6 +907,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { name, attrs, ast::ItemMod(ast::Mod { + inner: inner_span, view_items: vi, items: items, }) |
