1
Fork 0

use side table to store exported macros

Per discussion with @sfackler, refactored the expander to
change the way that exported macros are collected. Specifically,
a crate now contains a side table of spans that exported macros
go into.

This has two benefits. First, the encoder doesn't need to scan through
the expanded crate in order to discover exported macros. Second, the
expander can drop all expanded macros from the crate, with the pleasant
result that a fully expanded crate contains no macro invocations (which
include macro definitions).
This commit is contained in:
John Clements 2014-07-10 15:41:11 -07:00
parent 50d9965c25
commit f1ad425199
7 changed files with 34 additions and 35 deletions

View file

@ -5386,7 +5386,8 @@ impl<'a> Parser<'a> {
module: m,
attrs: inner,
config: self.cfg.clone(),
span: mk_sp(lo, self.span.lo)
span: mk_sp(lo, self.span.lo),
exported_macros: Vec::new(),
}
}