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

            Line data    Source code
       1              : #include "../../../inc/visitors/typeAnalysis/typeAnalysis.h"
       2              : #include "../../../inc/parsingAnalysis/ast/enum/ast_enum.h"
       3              : #include "../../../inc/parsingAnalysis/ast/enum/ast_enumAccess.h"
       4              : #include <memory>
       5              : 
       6              : namespace nicole {
       7              : 
       8              : /*
       9              : - retorna NoPropagate
      10              : */
      11              : std::expected<std::shared_ptr<Type>, Error>
      12            0 : TypeAnalysis::visit(const AST_ENUM *node) const noexcept {
      13            0 :   if (!node) {
      14            0 :     return createError(ERROR_TYPE::NULL_NODE, "invalid AST_ENUM");
      15            0 :   }
      16            0 :   const auto type{typeTable_->noPropagateType()};
      17            0 :   node->setReturnedFromAnalysis(type);
      18            0 :   return type;
      19            0 : }
      20              : 
      21              : /*
      22              : - retorna int
      23              : */
      24              : std::expected<std::shared_ptr<Type>, Error>
      25            0 : TypeAnalysis::visit(const AST_ENUM_ACCESS *node) const noexcept {
      26            0 :   if (!node) {
      27            0 :     return createError(ERROR_TYPE::NULL_NODE, "invalid AST_ENUM_ACCESS");
      28            0 :   }
      29            0 :   const auto type{typeTable_->getType(node->enumId())};
      30            0 :   if (!type) {
      31            0 :     return createError(ERROR_TYPE::TYPE, "enum does not exist");
      32            0 :   }
      33            0 :   node->setReturnedFromAnalysis(*type);
      34            0 :   return type;
      35            0 : }
      36              : 
      37              : }
        

Generated by: LCOV version 2.0-1