diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-06-19 01:00:49 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-07-11 00:12:07 +0300 |
| commit | ec376c783e3a64445c4b55fb5980ae922319a916 (patch) | |
| tree | 15053bf984ac34c06a42bb72dc1cff2964262b00 /src/libsyntax/ext | |
| parent | 48635226d8d71f18b09ea40f5cdbe34dbaaf378f (diff) | |
| download | rust-ec376c783e3a64445c4b55fb5980ae922319a916.tar.gz rust-ec376c783e3a64445c4b55fb5980ae922319a916.zip | |
Move `MacroKind` into `libsyntax_pos`
So it can be eventually used in `ExpnInfo`
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 8d5e4a3369e..09ff44115b4 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -24,6 +24,7 @@ use std::path::PathBuf; use std::rc::Rc; use std::default::Default; +pub use syntax_pos::hygiene::MacroKind; #[derive(Debug,Clone)] pub enum Annotatable { @@ -518,34 +519,6 @@ impl MacResult for DummyResult { } } -/// Represents different kinds of macro invocations that can be resolved. -#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] -pub enum MacroKind { - /// A bang macro - foo!() - Bang, - /// An attribute macro - #[foo] - Attr, - /// A derive attribute macro - #[derive(Foo)] - Derive, -} - -impl MacroKind { - pub fn descr(self) -> &'static str { - match self { - MacroKind::Bang => "macro", - MacroKind::Attr => "attribute macro", - MacroKind::Derive => "derive macro", - } - } - - pub fn article(self) -> &'static str { - match self { - MacroKind::Attr => "an", - _ => "a", - } - } -} - /// A syntax extension kind. pub enum SyntaxExtensionKind { /// A token-based function-like macro. |
