diff options
author | John Hodge (Mutabah) <acessdev@gmail.com> | 2016-12-25 17:19:27 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-25 17:19:27 +1100 |
commit | 753a2f44cc4c00b952cddae2ceed066ebb18a470 (patch) | |
tree | ed4bbff4be39c44c57164641f4ed32b5ad4675f0 /src/expand/cfg.cpp | |
parent | d12a8a886caf2e0edf33c1af831b1df990d2c892 (diff) | |
parent | 0c14c734fa32014fd24297ccdbed927016185ffd (diff) | |
download | mrust-753a2f44cc4c00b952cddae2ceed066ebb18a470.tar.gz |
Merge pull request #11 from ubsan/whitespace-fix
No more tears!
Diffstat (limited to 'src/expand/cfg.cpp')
-rw-r--r-- | src/expand/cfg.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/expand/cfg.cpp b/src/expand/cfg.cpp index e59da886..fcd31742 100644 --- a/src/expand/cfg.cpp +++ b/src/expand/cfg.cpp @@ -31,7 +31,7 @@ void Cfg_SetValueCb(::std::string name, ::std::function<bool(const ::std::string } bool check_cfg(Span sp, const ::AST::MetaItem& mi) { - + if( mi.has_sub_items() ) { // Must be `any`/`not`/`all` if( mi.name() == "any" || mi.name() == "cfg" ) { @@ -66,14 +66,14 @@ bool check_cfg(Span sp, const ::AST::MetaItem& mi) { DEBUG(""<<mi.name()<<": '"<<it->second<<"' == '"<<mi.string()<<"'"); return it->second == mi.string(); } - + auto it2 = g_cfg_value_fcns.find(mi.name()); if(it2 != g_cfg_value_fcns.end() ) { DEBUG(""<<mi.name()<<": ('"<<mi.string()<<"')?"); return it2->second( mi.string() ); } - + WARNING(sp, W0000, "Unknown cfg() param '" << mi.name() << "'"); return false; } @@ -93,11 +93,11 @@ class CCfgExpander: if( ident != "" ) { ERROR(sp, E0000, "cfg! doesn't take an identifier"); } - + auto lex = TTStream(tt); auto attrs = Parse_MetaItem(lex); DEBUG("cfg!() - " << attrs); - + if( check_cfg(sp, attrs) ) { return box$( TTStreamO(TokenTree({},TOK_RWORD_TRUE )) ); } @@ -112,8 +112,8 @@ class CCfgHandler: public ExpandDecorator { AttrStage stage() const override { return AttrStage::Pre; } - - + + void handle(const Span& sp, const AST::MetaItem& mi, AST::Crate& crate) const override { DEBUG("#[cfg] crate - " << mi); // Ignore, as #[cfg] on a crate is handled in expand/mod.cpp @@ -150,7 +150,7 @@ class CCfgHandler: impl.type() = ::TypeRef(sp); } } - + void handle(const Span& sp, const AST::MetaItem& mi, AST::Crate& crate, ::AST::StructItem& si) const override { DEBUG("#[cfg] struct item - " << mi); if( !check_cfg(sp, mi) ) { |