Line data Source code
1 : #include "../../../inc/visitors/fillSemanticInfo/fillSemanticInfo.h"
2 : #include "../../../inc/parsingAnalysis/ast/assignments/ast_assignment.h"
3 : #include <variant>
4 :
5 : namespace nicole {
6 :
7 : std::expected<std::monostate, Error>
8 0 : FillSemanticInfo::visit(const AST_ASSIGNMENT *node) const noexcept {
9 0 : if (!node) {
10 0 : return createError(ERROR_TYPE::NULL_NODE, "invalid AST_ASSIGNMENT");
11 0 : }
12 0 : const auto left{node->left()->accept(*this)};
13 0 : if (!left) {
14 0 : return createError(left.error());
15 0 : }
16 0 : const auto value{node->value()->accept(*this)};
17 0 : if (!value) {
18 0 : return createError(value.error());
19 0 : }
20 0 : return {};
21 0 : }
22 :
23 : }
|