Redo exported macro serialization
The old method of serializing the AST gives totally bogus spans if the expansion of an imported macro causes compilation errors. The best solution seems to be to serialize the actual textual macro definition and load it the same way the std-macros are. I'm not totally confident that getting the source from the CodeMap will always do the right thing, but it seems to work in simple cases.
This commit is contained in:
@@ -299,7 +299,7 @@ pub struct MacroCrate {
|
||||
|
||||
pub trait CrateLoader {
|
||||
fn load_crate(&mut self, crate: &ast::ViewItem) -> MacroCrate;
|
||||
fn get_exported_macros(&mut self, crate_num: ast::CrateNum) -> ~[@ast::Item];
|
||||
fn get_exported_macros(&mut self, crate_num: ast::CrateNum) -> ~[~str];
|
||||
fn get_registrar_symbol(&mut self, crate_num: ast::CrateNum) -> Option<~str>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user