LCOV - code coverage report
Current view: top level - inc/parsingAnalysis/ast/operators - ast_unary.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 21.7 % 23 5
Test Date: 2025-04-18 15:53:49 Functions: 33.3 % 9 3

            Line data    Source code
       1              : #ifndef AST_UNARY_H
       2              : #define AST_UNARY_H
       3              : 
       4              : #include "../../../lexicalAnalysis/token.h"
       5              : #include "../ast.h"
       6              : #include <memory>
       7              : 
       8              : namespace nicole {
       9              : 
      10              : class AST_UNARY : public AST {
      11              : private:
      12              :   Token op_;
      13              :   std::shared_ptr<AST> value_;
      14              : 
      15              : public:
      16              :   explicit AST_UNARY(const long long unsigned nodeId,
      17              :                      const SourceLocation &srcLoc, const Token &op,
      18              :                      const std::shared_ptr<AST> &value) noexcept
      19            1 :       : AST(nodeId, AST_TYPE::UNARY, srcLoc), op_{op}, value_{value} {}
      20              : 
      21            9 :   [[nodiscard]] const Token &op() const noexcept { return op_; }
      22              : 
      23           18 :   [[nodiscard]] const std::shared_ptr<AST> &value() const noexcept {
      24           18 :     return value_;
      25           18 :   }
      26              : 
      27              :   [[nodiscard]] std::expected<std::string, Error>
      28            0 :   accept(const PrintTree &visitor) const noexcept override {
      29            0 :     return visitor.visit(this);
      30            0 :   }
      31              : 
      32              :   [[nodiscard]] std::expected<bool, Error>
      33            0 :   accept(const ValidateTree &visitor) const noexcept override {
      34            0 :     return visitor.visit(this);
      35            0 :   }
      36              : 
      37              :   [[nodiscard]] std::expected<std::monostate, Error>
      38            0 :   accept(const FillSemanticInfo &visitor) const noexcept override {
      39            0 :     return visitor.visit(this);
      40            0 :   }
      41              : 
      42              :   [[nodiscard]] std::expected<std::shared_ptr<Type>, Error>
      43            0 :   accept(const TypeAnalysis &visitor) const noexcept override {
      44            0 :     return visitor.visit(this);
      45            0 :   }
      46              : 
      47              :   [[nodiscard]] std::expected<std::monostate, Error>
      48            0 :   accept(const Monomorphize &visitor) const noexcept override {
      49            0 :     return visitor.visit(this);
      50            0 :   }
      51              : 
      52              :   [[nodiscard]] std::expected<std::shared_ptr<llvm::Value>, Error>
      53            0 :   accept(const CodeGeneration &visitor) const noexcept override {
      54            0 :     return visitor.visit(this);
      55            0 :   }
      56              : };
      57              : 
      58              : } // namespace nicole
      59              : 
      60              : #endif
        

Generated by: LCOV version 2.0-1