1
Fork 0

syntax: Add tokens: Option<TokenStream> to Item

This commit adds a new field to the `Item` AST node in libsyntax to optionally
contain the original token stream that the item itself was parsed from. This is
currently `None` everywhere but is intended for use later with procedural
macros.
This commit is contained in:
Alex Crichton 2017-07-10 17:44:46 -07:00
parent 6f815ca771
commit 9b2f7624ec
11 changed files with 35 additions and 9 deletions

View file

@ -60,6 +60,7 @@ pub fn maybe_inject_crates_ref(mut krate: ast::Crate, alt_std_name: Option<Strin
ident: ast::Ident::from_str(name),
id: ast::DUMMY_NODE_ID,
span: DUMMY_SP,
tokens: None,
}));
let span = ignored_span(DUMMY_SP);
@ -82,6 +83,7 @@ pub fn maybe_inject_crates_ref(mut krate: ast::Crate, alt_std_name: Option<Strin
id: ast::DUMMY_NODE_ID,
ident: keywords::Invalid.ident(),
span: span,
tokens: None,
}));
krate