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:
parent
09a879460c
commit
3ef933647a
4 changed files with 29 additions and 4 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue