Add Tests for ZCG cpp

This commit is contained in:
Jan
2021-02-10 18:03:50 +01:00
parent 31497d804c
commit f9ef7cc35b
102 changed files with 502 additions and 21 deletions

View File

@ -0,0 +1,32 @@
#include "ParsingException.h"
#include <sstream>
ParsingException::ParsingException(const TokenPos position, std::string message)
: m_pos(position),
m_message(std::move(message))
{
std::ostringstream str;
str << m_pos.m_line << ':' << m_pos.m_column << ' ' << m_message;
m_full_message = str.str();
}
TokenPos ParsingException::Position() const
{
return m_pos;
}
const std::string& ParsingException::Message() const
{
return m_message;
}
std::string ParsingException::FullMessage() const
{
return m_full_message;
}
char const* ParsingException::what() const
{
return m_full_message.c_str();
}