Associate multiple with a crate too.
This commit is contained in:
parent
e9035f7bef
commit
b82795244e
17 changed files with 28 additions and 27 deletions
|
@ -331,7 +331,7 @@ pub fn fake_token_stream(sess: &ParseSess, nt: &Nonterminal) -> TokenStream {
|
|||
pub fn fake_token_stream_for_crate(sess: &ParseSess, krate: &ast::Crate) -> TokenStream {
|
||||
let source = pprust::crate_to_string_for_macros(krate);
|
||||
let filename = FileName::macro_expansion_source_code(&source);
|
||||
parse_stream_from_source_str(filename, source, sess, Some(krate.span))
|
||||
parse_stream_from_source_str(filename, source, sess, Some(krate.spans.inner_span))
|
||||
}
|
||||
|
||||
pub fn parse_cfg_attr(
|
||||
|
|
|
@ -27,8 +27,7 @@ impl<'a> Parser<'a> {
|
|||
/// Parses a source module as a crate. This is the main entry point for the parser.
|
||||
pub fn parse_crate_mod(&mut self) -> PResult<'a, ast::Crate> {
|
||||
let (attrs, items, spans) = self.parse_mod(&token::Eof)?;
|
||||
let span = spans.inner_span;
|
||||
Ok(ast::Crate { attrs, items, span, id: DUMMY_NODE_ID, is_placeholder: false })
|
||||
Ok(ast::Crate { attrs, items, spans, id: DUMMY_NODE_ID, is_placeholder: false })
|
||||
}
|
||||
|
||||
/// Parses a `mod <foo> { ... }` or `mod <foo>;` item.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue