Add support for diagnostics to parser

This commit is contained in:
2019-05-21 14:00:14 +02:00
parent 2b35da3a7b
commit 99f50b6471
5 changed files with 40 additions and 24 deletions

View File

@@ -7,6 +7,8 @@
#include "../BinaryOperatorKind.hpp"
enum class ParsedExpressionKind{
Bad,
LiteralInteger,
LiteralFloat,
LiteralString,
@@ -40,6 +42,15 @@ public:
}
};
class BadExpression : public ParsedExpression{
public:
BadExpression(unsigned int position, unsigned int length) : ParsedExpression(position, length){}
ParsedExpressionKind GetKind() final{
return ParsedExpressionKind::Bad;
}
};
class LiteralIntegerExpression : public ParsedExpression{
long _value;
public: