Expressions logging

This commit is contained in:
Rafał Grodziński
2025-07-02 17:36:05 +09:00
parent 6f769c77b7
commit e9d55a2ed1
5 changed files with 124 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ Expression(ExpressionKind::BLOCK, ValueType::NONE) {
valueType = resultStatementExpression->getExpression()->getValueType();
statements.pop_back();
} else {
resultStatementExpression = make_shared<StatementExpression>(ExpressionLiteral::NONE);
resultStatementExpression = make_shared<StatementExpression>(make_shared<ExpressionLiteral>());
}
statementBlock = make_shared<StatementBlock>(statements);
}

View File

@@ -1,7 +1,5 @@
#include "ExpressionLiteral.h"
shared_ptr<ExpressionLiteral> ExpressionLiteral::NONE;
ExpressionLiteral::ExpressionLiteral():
Expression(ExpressionKind::LITERAL, ValueType::NONE) { }

View File

@@ -6,12 +6,10 @@ private:
int32_t sint32Value;
float real32Value;
ExpressionLiteral();
public:
static shared_ptr<ExpressionLiteral> NONE;
ExpressionLiteral(shared_ptr<Token> token);
ExpressionLiteral();
bool getBoolValue();
int32_t getSint32Value();
float getReal32Value();