diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-06-24 19:54:23 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-06-30 01:53:32 +0300 |
| commit | 99ecdb3f5fc49efb3eccdd10fbe12dc98623a938 (patch) | |
| tree | 7c82e4221bf6f94e44ca58399c873b2b9eb29a25 /src/libsyntax/ext/base.rs | |
| parent | 09856c85b73feff1db93990cd3d80f2c585b40c4 (diff) | |
| download | rust-99ecdb3f5fc49efb3eccdd10fbe12dc98623a938.tar.gz rust-99ecdb3f5fc49efb3eccdd10fbe12dc98623a938.zip | |
hygiene: Implement transparent marks
Diffstat (limited to 'src/libsyntax/ext/base.rs')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 78fa3f326d6..e2424de4d14 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -649,6 +649,7 @@ pub enum SyntaxExtension { DeclMacro { expander: Box<TTMacroExpander + sync::Sync + sync::Send>, def_info: Option<(ast::NodeId, Span)>, + is_transparent: bool, edition: Edition, } } @@ -682,6 +683,13 @@ impl SyntaxExtension { } } + pub fn is_transparent(&self) -> bool { + match *self { + SyntaxExtension::DeclMacro { is_transparent, .. } => is_transparent, + _ => false, + } + } + pub fn edition(&self) -> Edition { match *self { SyntaxExtension::NormalTT { edition, .. } | |
