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.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'minicc.h') diff --git a/minicc.h b/minicc.h index 92678a1..28b494a 100644 --- a/minicc.h +++ b/minicc.h @@ -1,3 +1,5 @@ +// Common definitions + #pragma once #include @@ -19,8 +21,8 @@ struct Location { size_t column{1}; size_t pos{0}; - void advance(bool newline = false); - std::string toString(); + void advance(bool newline = false); ///< advance 1 char + std::string toString() const; }; bool operator==(const Location &a, const Location &b); @@ -29,6 +31,8 @@ struct Token { std::string type; std::string value; Location location; + + std::string toString() const; }; // For printing via Google Test -- cgit v1.2.3