diff --git a/Matcher.cpp b/Matcher.cpp
index 1b65158..54cd9d9 100644
--- a/Matcher.cpp
+++ b/Matcher.cpp
@@ -18,7 +18,7 @@
     Token dataHead = data.first();
     pattern.removeFirst();
 
-    if (ph.isSym() || ph.isIdent())
+    if (ph.isSym() || ph.isIdent() || ph.isInteger())
     {
         if (ph == data.first())
         {
@@ -90,7 +90,7 @@
                     typeIsOk = true;
 
             case 's':
-                if (dataHead.isSym() || dataHead.isIdent())
+                if (dataHead.isSym() || dataHead.isIdent() || dataHead.isInteger())
                     typeIsOk = true;
 
                 if (!typeIsOk)
diff --git a/Parser.cpp b/Parser.cpp
index fd07c79..c3d8330 100644
--- a/Parser.cpp
+++ b/Parser.cpp
@@ -78,7 +78,7 @@
         while (peek().isDigit())
             buffer += get();
 
-        *node = T(buffer.toInt());
+        *node = T(buffer, 10);
         return true;
     }
 
diff --git a/Token.cpp b/Token.cpp
index ac104a4..20e2a16 100644
--- a/Token.cpp
+++ b/Token.cpp
@@ -38,6 +38,13 @@
 }
 
 template <typename T>
+TokenBase<T>::TokenBase(QString integer, int base)
+{
+	_type = INTEGER;
+	_intVal = integer.toInt(nullptr, base);
+}
+
+template <typename T>
 TokenBase<T>::TokenBase(char varType, const QString name)
 {
     _type = VAR;
@@ -69,6 +76,12 @@
 }
 
 template <typename T>
+bool TokenBase<T>::isInteger() const
+{
+	return _type == INTEGER;
+}
+
+template <typename T>
 TokenBase<T>::TokenBase() : TokenBase("Null")
 {
 }
@@ -93,6 +106,12 @@
 }
 
 template <typename T>
+int TokenBase<T>::integer() const
+{
+	return _intVal;
+}
+
+template <typename T>
 char TokenBase<T>::varType() const
 {
     return _charVal.toLatin1();
@@ -119,6 +138,8 @@
         return _charVal;
     if (isVar())
         return QString(_charVal) + "." + _stringVal;
+	if (isInteger())
+		return QString::number(_intVal, 10);
     if (isParen())
     {
         QStringList parts;
@@ -142,7 +163,7 @@
 template <typename T>
 QString TokenBase<T>::typeToString(int type)
 {
-    static const QString typeNames[] = {"SYMBOL", "IDENT", "PAREN", "VAR"};
+    static const QString typeNames[] = {"SYMBOL", "IDENT", "PAREN", "VAR", "INTEGER"};
     return typeNames[type];
 }
 
diff --git a/Token.h b/Token.h
index 75c4455..6e0450c 100644
--- a/Token.h
+++ b/Token.h
@@ -10,6 +10,7 @@
     TokenBase();
     TokenBase(const T &other);
 
+	TokenBase(QString integer, int base);
     explicit TokenBase(QChar symbol);
     explicit TokenBase(QString identifier);
     explicit TokenBase(QList<T> parenthesized);
@@ -22,12 +23,14 @@
     bool isIdent() const;
     bool isParen() const;
     bool isVar() const;
+	bool isInteger() const;
 
     QList<T> parenContent();
 
     char varType() const;
     const QString &name() const;
     QChar symbol() const;
+	int integer() const;
 
     operator QString() const;
 
@@ -37,6 +40,7 @@
         IDENT,
         PAREN,
         VAR,
+		INTEGER,
         TOKEN_TYPE_LAST,
     };
 
@@ -46,6 +50,7 @@
 
 protected:
     int _type = 0;
+	int _intVal = 0;
     QString _stringVal = "";
     QList<T> _listVal;
     QChar _charVal = 0;
diff --git a/main.cpp b/main.cpp
index 765e380..9a276f0 100644
--- a/main.cpp
+++ b/main.cpp
@@ -9,6 +9,7 @@
 #include "Evaluator.h"
 #include "VarContext.h"
 #include "Repl.h"
+#include "PPrint.h"
 
 int g_numFailed = 0;
 
@@ -100,13 +101,20 @@
 			  match(dataParser.parseMany<Token>(), patternParser.parseMany<Token>(), VarContext()));
 }
 
-void testParseAst(QString string)
+void testParseAst(QString string, QList<AstNode> equals = {})
 {
     Parser parser{string};
 
     QList<AstNode> result = parser.parseMany<AstNode>();
 
-    qDebug() << "\033[36mParse\033[0m" << string << result;
+	if (!equals.empty() && result != equals)
+	{
+        g_numFailed++;
+        qDebug() << "\n\033[31mTEST FAILS:\033[0m";
+        qDebug() << "Expected" << pprint(equals);
+	}
+
+    qDebug() << "\033[36mParse\033[0m" << string << pprint(result);
 }
 
 void testParseFunc(QString string)
@@ -182,6 +190,9 @@
 
     testMatch("(a)", "(a)");
 	testMatch("hello", "s.A e.Rest");
+	testMatch("123", "123");
+	testMatch("(123)", "t.a");
+	testMatch("(123)", "(s.a)");
 }
 
 void testAllParses()
@@ -198,6 +209,8 @@
     testParseAst("(s.a) e.Middle s.a");
     testParseAst("Hello; Goodbye");
     testParseAst("Key = Value");
+	testParseAst("123", {AstNode("123", 10)});
+	testParseAst("12 00", {AstNode("12", 10), AstNode("0", 10)});
 }
 
 void testAllFunctionDefs()
