summaryrefslogtreecommitdiffhomepage
path: root/minicc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'minicc.cpp')
-rw-r--r--minicc.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/minicc.cpp b/minicc.cpp
index d180517..88cb6ab 100644
--- a/minicc.cpp
+++ b/minicc.cpp
@@ -50,7 +50,13 @@ void Location::advance(bool newline)
}
}
-std::string Location::toString()
+std::string Location::toString() const
{
return std::to_string(line) + ":"s + std::to_string(column);
}
+
+std::string Token::toString() const
+{
+ return location.toString() + ": "s + value + " ("s + type + ")"s;
+}
+