Add AssertionException, specialize pprint
diff --git a/PPrint.h b/PPrint.h
index 6298d6b..3ae9546 100644
--- a/PPrint.h
+++ b/PPrint.h
@@ -3,6 +3,8 @@
#include <QString>
#include <QList>
+#include <type_traits>
+
#include "Token.h"
#include "AstNode.h"
#include "Parser.h"
@@ -16,6 +18,25 @@
//template <>
//QString pprint<AstNode>(AstNode val);
+template <typename T, typename std::enable_if_t<std::is_base_of<TokenBase<T>, T>::value>::value = true>
+QString pprint(QList<T> val)
+{
+ QString out;
+ int lastType = -1;
+
+ qInfo() << "pprint specialized";
+
+ for (const T &v : val)
+ {
+ if ((lastType != v.type() || v.type() != T::SYMBOL) && lastType != -1)
+ out += " ";
+
+ out += QString(v);
+ }
+
+ return out;
+}
+
template <typename T>
QString pprint(QList<T> val)
{