summaryrefslogtreecommitdiffhomepage
path: root/minicc.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-10-31 18:10:58 +0100
committerRoland Reichwein <mail@reichwein.it>2020-10-31 18:10:58 +0100
commit8256280b348b4b53fff35c9101ced0a8dfb2c58e (patch)
treee745b79e98c853cf1891372e8b2a926a5d81fff5 /minicc.cpp
parentce77838c4f32b9dc237f0c4b17d1f1e1741254d4 (diff)
CPP::translate() (WIP), documentation, bugfixing
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;
+}
+