summaryrefslogtreecommitdiff
path: root/src/macros.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2015-03-14 22:29:51 +0800
committerJohn Hodge <tpg@mutabah.net>2015-03-14 22:29:51 +0800
commitbf14a518b591b8f43a92c13d85b1ae5db8965703 (patch)
treea01c5a6183093fe8f6d8e1f63f4c1d33f631ad52 /src/macros.hpp
parent2cd588ca7d71b00c93429c733ce28d78cdd415eb (diff)
downloadmrust-bf14a518b591b8f43a92c13d85b1ae5db8965703.tar.gz
Fixed macros, added range syntax and other tweaks
Diffstat (limited to 'src/macros.hpp')
-rw-r--r--src/macros.hpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/macros.hpp b/src/macros.hpp
index 2fa74698..bb25f38a 100644
--- a/src/macros.hpp
+++ b/src/macros.hpp
@@ -39,7 +39,15 @@ public:
}
friend ::std::ostream& operator<<(::std::ostream& os, const MacroRuleEnt& x) {
- return os << "MacroRuleEnt( '"<<x.name<<"'" << x.tok << ", " << x.subpats << ")";
+ os << "MacroRuleEnt(";
+ if(x.name.size())
+ os << "'"<<x.name<<"'";
+ else if( x.subpats.size() )
+ os << x.tok << " [" << x.subpats << "]";
+ else
+ os << x.tok;
+ os << ")";
+ return os;
}
SERIALISABLE_PROTOTYPES();
@@ -90,8 +98,16 @@ struct MacroPatEnt:
{
}
- friend ::std::ostream& operator<<(::std::ostream& os, const MacroPatEnt& mpe) {
- return os << "MacroPatEnt( '"<<mpe.name<<"'" << mpe.tok << ", " << mpe.subpats << ")";
+ friend ::std::ostream& operator<<(::std::ostream& os, const MacroPatEnt& x) {
+ os << "MacroPatEnt(";
+ if(x.name.size())
+ os << "'"<<x.name<<"'";
+ else if( x.subpats.size() )
+ os << x.tok << " [" << x.subpats << "]";
+ else
+ os << x.tok;
+ os << ")";
+ return os;
}
SERIALISABLE_PROTOTYPES();