From 8f78bcaeaac05e2b53a14e01ed5ab9dc29056836 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Thu, 14 Nov 2019 08:03:47 +0100 Subject: [PATCH] improve lexer tokens printing --- alib2cli/src/lexer/Lexer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alib2cli/src/lexer/Lexer.h b/alib2cli/src/lexer/Lexer.h index 1d7c276be0..2b76413007 100644 --- a/alib2cli/src/lexer/Lexer.h +++ b/alib2cli/src/lexer/Lexer.h @@ -129,6 +129,10 @@ public: operator std::string ( ) const { std::string res = Lexer::tokenTypeToString ( m_type ); + + if ( m_value.empty ( ) ) + return res; + switch ( m_type ) { case TokenType::IDENTIFIER : return res + ": " + m_value; -- GitLab