• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

polserver / polserver / 25918451630

15 May 2026 12:43PM UTC coverage: 60.929% (+2.1%) from 58.859%
25918451630

push

github

turleypol
added dynamic property which returns a pointer of the object instead of
a copy like the current imp.
needed to be able to eg store a vector

43 of 61 new or added lines in 2 files covered. (70.49%)

14455 existing lines in 345 files now uncovered.

44695 of 73356 relevant lines covered (60.93%)

449621.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.33
/pol-core/bscript/compiler/ast/ClassDeclaration.cpp
1
#include "ClassDeclaration.h"
2

3
#include "bscript/compiler/ast/ClassParameterDeclaration.h"
4
#include "bscript/compiler/ast/ClassParameterList.h"
5
#include "bscript/compiler/ast/NodeVisitor.h"
6
#include "bscript/compiler/ast/UninitializedFunctionDeclaration.h"
7
#include "bscript/compiler/ast/UserFunction.h"
8
#include "bscript/compiler/file/SourceFileIdentifier.h"
9
#include "bscript/compiler/model/ClassLink.h"
10
#include "bscript/compiler/model/FunctionLink.h"
11

12
#include <ranges>
13

14
namespace Pol::Bscript::Compiler
15
{
16
ClassDeclaration::ClassDeclaration(
695✔
17
    const SourceLocation& source_location, std::string name,
18
    std::unique_ptr<ClassParameterList> parameters, std::shared_ptr<FunctionLink> constructor_link,
19
    ClassMethodMap methods, Node* class_body,
20
    std::vector<std::shared_ptr<ClassLink>> base_class_links,
21
    std::vector<std::unique_ptr<UninitializedFunctionDeclaration>> uninit_functions )
695✔
22
    : Node( source_location ),
23
      name( std::move( name ) ),
695✔
24
      methods( std::move( methods ) ),
695✔
25
      class_body( class_body ),
695✔
26
      constructor_link( std::move( constructor_link ) ),
695✔
27
      base_class_links( std::move( base_class_links ) )
1,390✔
28
{
29
  children.reserve( 1 + uninit_functions.size() );
695✔
30
  children.push_back( std::move( parameters ) );
695✔
31
  std::ranges::move( uninit_functions, std::back_inserter( children ) );
695✔
32
}
695✔
33

34
void ClassDeclaration::accept( NodeVisitor& visitor )
2,053✔
35
{
36
  visitor.visit_class_declaration( *this );
2,053✔
37
}
2,053✔
38

39
void ClassDeclaration::describe_to( std::string& w ) const
4✔
40
{
41
  fmt::format_to( std::back_inserter( w ), "class-declaration({})", name );
4✔
42
}
4✔
43

44
std::vector<std::reference_wrapper<ClassParameterDeclaration>> ClassDeclaration::parameters()
693✔
45
{
46
  std::vector<std::reference_wrapper<ClassParameterDeclaration>> params;
693✔
47

48
  child<ClassParameterList>( 0 ).get_children<ClassParameterDeclaration>( params );
693✔
49

50
  return params;
693✔
UNCOV
51
}
×
52

53
std::vector<std::reference_wrapper<UninitializedFunctionDeclaration>>
54
ClassDeclaration::uninit_functions()
1,449✔
55
{
56
  std::vector<std::reference_wrapper<UninitializedFunctionDeclaration>> params;
1,449✔
57

58
  // The first child is a `ClassParameterList`, so skip it.
59
  for ( auto& param : children | std::views::drop( 1 ) )
1,653✔
60
  {
61
    params.emplace_back( *static_cast<UninitializedFunctionDeclaration*>( param.get() ) );
204✔
62
  }
63

64
  return params;
1,449✔
UNCOV
65
}
×
66

67
std::string ClassDeclaration::type_tag() const
727✔
68
{
69
  return fmt::format( "{}@{}", name, source_location.source_file_identifier->pathname );
1,454✔
70
}
71
}  // namespace Pol::Bscript::Compiler
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc