LCOV - code coverage report
Current view: top level - src/visitors/validateTree - validateChained.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 20 0
Test Date: 2025-04-18 15:53:49 Functions: 0.0 % 1 0

            Line data    Source code
       1              : #include "../../../inc/visitors/validateTree/validateTree.h"
       2              : #include "../../../inc/parsingAnalysis/ast/chained/ast_chained.h"
       3              : #include "../../../inc/parsingAnalysis/checkPosition.h"
       4              : 
       5              : namespace nicole {
       6              : 
       7              : std::expected<bool, Error>
       8            0 : ValidateTree::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 :   if (CheckPosition::isOutOfScope(node)) {
      13            0 :     return createError(ERROR_TYPE::VALIDATE_TREE,
      14            0 :                        "chained expressions cannot appear outside of scopes");
      15            0 :   }
      16            0 :   const auto base{node->base()->accept(*this)};
      17            0 :   if (!base) {
      18            0 :     return createError(base.error());
      19            0 :   }
      20            0 :   for (const auto &chain : node->operations()) {
      21            0 :     const auto result{chain->accept(*this)};
      22            0 :     if (!result) {
      23            0 :       return createError(result.error());
      24            0 :     }
      25            0 :   }
      26            0 :   return true;
      27            0 : }
      28              : 
      29              : }
        

Generated by: LCOV version 2.0-1