syntax: print expansion info from #[attribute] macros in the correct
format. Previously, any attempt to use this information from inside something like #[deriving(Foo)] would result in it printing like `deriving(Foo)!`.
This commit is contained in:
@@ -161,8 +161,22 @@ pub struct LocWithOpt {
|
||||
// used to be structural records. Better names, anyone?
|
||||
pub struct FileMapAndLine {fm: @FileMap, line: uint}
|
||||
pub struct FileMapAndBytePos {fm: @FileMap, pos: BytePos}
|
||||
|
||||
#[deriving(IterBytes)]
|
||||
pub struct NameAndSpan {name: @str, span: Option<Span>}
|
||||
pub enum MacroFormat {
|
||||
// e.g. #[deriving(...)] <item>
|
||||
MacroAttribute,
|
||||
// e.g. `format!()`
|
||||
MacroBang
|
||||
}
|
||||
|
||||
#[deriving(IterBytes)]
|
||||
pub struct NameAndSpan {
|
||||
name: @str,
|
||||
// the format with which the macro was invoked.
|
||||
format: MacroFormat,
|
||||
span: Option<Span>
|
||||
}
|
||||
|
||||
/// Extra information for tracking macro expansion of spans
|
||||
#[deriving(IterBytes)]
|
||||
|
||||
Reference in New Issue
Block a user