From 8256280b348b4b53fff35c9101ced0a8dfb2c58e Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 31 Oct 2020 18:10:58 +0100 Subject: CPP::translate() (WIP), documentation, bugfixing --- minicc.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'minicc.cpp') 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; +} + -- cgit v1.2.3