summaryrefslogtreecommitdiff
path: root/src/macros.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2015-03-21 13:52:34 +0800
committerJohn Hodge <tpg@mutabah.net>2015-03-21 13:52:34 +0800
commite199a51dfd19eacd9c423cfff8bbc2dc2c64ac6d (patch)
tree0799b014b8de37282e3a032895da02b9f86e4eb1 /src/macros.hpp
parentde16b83e86ac67aa02c188bdcbb3d19088a90b97 (diff)
downloadmrust-e199a51dfd19eacd9c423cfff8bbc2dc2c64ac6d.tar.gz
Rework macro handling to (hopefully) correctly handle nested repetions
Diffstat (limited to 'src/macros.hpp')
-rw-r--r--src/macros.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/macros.hpp b/src/macros.hpp
index 05c337b0..1111b2f2 100644
--- a/src/macros.hpp
+++ b/src/macros.hpp
@@ -101,6 +101,19 @@ struct MacroPatEnt:
friend ::std::ostream& operator<<(::std::ostream& os, const MacroPatEnt& x) {
os << "MacroPatEnt(";
+ switch(x.type)
+ {
+ case PAT_TOKEN: os << "token "; break;
+ case PAT_TT: os << "tt "; break;
+ case PAT_PAT: os << "pat "; break;
+ case PAT_IDENT: os << "ident "; break;
+ case PAT_PATH: os << "path "; break;
+ case PAT_TYPE: os << "type "; break;
+ case PAT_EXPR: os << "expr "; break;
+ case PAT_STMT: os << "stmt "; break;
+ case PAT_BLOCK: os << "block "; break;
+ case PAT_LOOP: os << "loop "; break;
+ }
if(x.name.size())
os << "'"<<x.name<<"'";
else if( x.subpats.size() )