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