summaryrefslogtreecommitdiff
path: root/src/macros.hpp
diff options
context:
space:
mode:
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();