• 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

87.01
/pol-core/bscript/compilercfg.cpp
1
/** @file
2
 *
3
 * @par History
4
 */
5

6

7
#include "compilercfg.h"
8

9
#include <stdlib.h>
10

11
#include "../clib/Program/ProgramConfig.h"
12
#include "../clib/cfgelem.h"
13
#include "../clib/cfgfile.h"
14
#include "../clib/fileutil.h"
15

16

17
namespace Pol::Bscript
18
{
19
void CompilerConfig::Read( const std::string& path )
2,956✔
20
{
21
#ifdef _WIN32
22
  bool win_platform = true;
23
#else
24
  bool win_platform = false;
2,956✔
25
#endif
26

27
  Clib::ConfigFile cf( path.c_str() );
2,956✔
28
  Clib::ConfigElem elem;
2,956✔
29
  cf.readraw( elem );
2,956✔
30

31
  PackageRoot.clear();
2,956✔
32
  IncludeDirectory.clear();
2,956✔
33

34
  std::string tmp;
2,956✔
35
  while ( elem.remove_prop( "PackageRoot", &tmp ) )
5,912✔
36
  {
37
    PackageRoot.push_back( Clib::normalized_dir_form( tmp ) );
2,956✔
38
  }
39
  if ( elem.remove_prop( "IncludeDirectory", &tmp ) )
2,956✔
40
  {
41
    IncludeDirectory = Clib::normalized_dir_form( tmp );
2,956✔
42
  }
43
  ModuleDirectory = Clib::normalized_dir_form( elem.remove_string( "ModuleDirectory" ) );
2,956✔
44
  PolScriptRoot = Clib::normalized_dir_form( elem.remove_string( "PolScriptRoot" ) );
2,956✔
45
  GenerateListing = elem.remove_bool( "GenerateListing", false );
2,956✔
46
  GenerateDebugInfo = elem.remove_bool( "GenerateDebugInfo", false );
2,956✔
47
  GenerateDebugTextInfo = elem.remove_bool( "GenerateDebugTextInfo", false );
2,956✔
48
  GenerateAbstractSyntaxTree = elem.remove_bool( "GenerateAbstractSyntaxTree", false );
2,956✔
49

50
  VerbosityLevel = elem.remove_int( "VerbosityLevel", 0 );
2,956✔
51
  DisplayWarnings = elem.remove_bool( "DisplayWarnings", false );
2,956✔
52
  CompileAspPages = elem.remove_bool( "CompileAspPages", false );
2,956✔
53
  AutoCompileByDefault = elem.remove_bool( "AutoCompileByDefault", false );
2,956✔
54
  UpdateOnlyOnAutoCompile = elem.remove_bool( "UpdateOnlyOnAutoCompile", false );
2,956✔
55
  OnlyCompileUpdatedScripts = elem.remove_bool( "OnlyCompileUpdatedScripts", false );
2,956✔
56
  WatchModeByDefault = elem.remove_bool( "WatchModeByDefault", false );
2,956✔
57
  DisplaySummary = elem.remove_bool( "DisplaySummary", false );
2,956✔
58
  OptimizeObjectMembers = elem.remove_bool( "OptimizeObjectMembers", true );
2,956✔
59
  ErrorOnWarning = elem.remove_bool( "ErrorOnWarning", false );
2,956✔
60
  GenerateDependencyInfo = elem.remove_bool( "GenerateDependencyInfo", OnlyCompileUpdatedScripts );
2,956✔
61

62
  DisplayUpToDateScripts = elem.remove_bool( "DisplayUpToDateScripts", true );
2,956✔
63
  ThreadedCompilation = elem.remove_bool( "ThreadedCompilation", false );
2,956✔
64
  NumberOfThreads = elem.remove_int( "NumberOfThreads", 0 );
2,956✔
65
  ParanoiaWarnings = elem.remove_bool( "ParanoiaWarnings", false );
2,956✔
66
  ErrorOnFileCaseMissmatch = elem.remove_bool( "ErrorOnFileCaseMissmatch", false );
2,956✔
67

68
  EmParseTreeCacheSize = elem.remove_int( "EmParseTreeCacheSize", 25 );
2,956✔
69
  IncParseTreeCacheSize = elem.remove_int( "IncParseTreeCacheSize", 50 );
2,956✔
70

71
  ShortCircuitEvaluation = elem.remove_bool( "ShortCircuitEvaluation", false );
2,956✔
72
  ShortCircuitEvaluationWarning = elem.remove_bool( "ShortCircuitEvaluationWarning", true );
2,956✔
73

74
  FormatterLineWidth = elem.remove_unsigned( "FormatterLineWidth", 100 );
2,956✔
75
  FormatterKeepKeywords = elem.remove_bool( "FormatterKeepKeywords", false );
2,956✔
76
  FormatterIndentLevel = elem.remove_ushort( "FormatterIndentLevel", 2 );
2,956✔
77
  FormatterMergeEmptyLines = elem.remove_bool( "FormatterMergeEmptyLines", true );
2,956✔
78
  FormatterEmptyParenthesisSpacing = elem.remove_bool( "FormatterEmptyParenthesisSpacing", false );
2,956✔
79
  FormatterEmptyBracketSpacing = elem.remove_bool( "FormatterEmptyBracketSpacing", false );
2,956✔
80
  FormatterConditionalParenthesisSpacing =
2,956✔
81
      elem.remove_bool( "FormatterConditionalParenthesisSpacing", true );
2,956✔
82
  FormatterParenthesisSpacing = elem.remove_bool( "FormatterParenthesisSpacing", true );
2,956✔
83
  FormatterBracketSpacing = elem.remove_bool( "FormatterBracketSpacing", true );
2,956✔
84
  FormatterDelimiterSpacing = elem.remove_bool( "FormatterDelimiterSpacing", true );
2,956✔
85
  FormatterAssignmentSpacing = elem.remove_bool( "FormatterAssignmentSpacing", true );
2,956✔
86
  FormatterComparisonSpacing = elem.remove_bool( "FormatterComparisonSpacing", true );
2,956✔
87
  FormatterEllipsisSpacing = elem.remove_bool( "FormatterEllipsisSpacing", false );
2,956✔
88
  FormatterOperatorSpacing = elem.remove_bool( "FormatterOperatorSpacing", true );
2,956✔
89
  FormatterWindowsLineEndings = elem.remove_bool( "FormatterWindowsLineEndings", win_platform );
2,956✔
90
  FormatterUseTabs = elem.remove_bool( "FormatterUseTabs", false );
2,956✔
91
  FormatterTabWidth = elem.remove_ushort( "FormatterTabWidth", 4 );
2,956✔
92
  FormatterInsertNewlineAtEOF = elem.remove_bool( "FormatterInsertNewlineAtEOF", true );
2,956✔
93
  FormatterFormatInsideComments = elem.remove_bool( "FormatterFormatInsideComments", true );
2,956✔
94
  FormatterBracketAttachToType = elem.remove_bool( "FormatterBracketAttachToType", true );
2,956✔
95
  FormatterAlignTrailingComments = elem.remove_bool( "FormatterAlignTrailingComments", true );
2,956✔
96
  FormatterAlignConsecutiveShortCaseStatements =
2,956✔
97
      elem.remove_bool( "FormatterAlignConsecutiveShortCaseStatements", true );
2,956✔
98
  FormatterAllowShortCaseLabelsOnASingleLine =
2,956✔
99
      elem.remove_bool( "FormatterAllowShortCaseLabelsOnASingleLine", true );
2,956✔
100
  FormatterAllowShortFuncRefsOnASingleLine =
2,956✔
101
      elem.remove_bool( "FormatterAllowShortFuncRefsOnASingleLine", true );
2,956✔
102

103

104
  // This is where we TRY to validate full paths from what was provided in the
105
  // ecompile.cfg. Maybe Turley or Shini can find the best way to do this in *nix.
106
#ifdef WIN32
107
  std::string MyPath = path.c_str();
108
  // If it's just "ecompile.cfg", let's change it to the exe's path which it SHOULD be
109
  // with.
110
  if ( stricmp( MyPath.c_str(), "ecompile.cfg" ) == 0 )
111
  {
112
    std::string workingDir = PROG_CONFIG::programDir();
113

114
    // Let's find the NEXT-TO-LAST / in the path, and remove from there on. Oh yay!
115
    // To bad we can't just force everyone to use ABSOLUTE PATHS NANDO. :o
116
    MyPath = workingDir.substr( 0, workingDir.length() - 1 );
117
    MyPath = MyPath.substr( 0, MyPath.find_last_of( '/' ) + 1 );
118
  }
119
  if ( IncludeDirectory.find( ':' ) == std::string::npos )
120
  {
121
    if ( IncludeDirectory.substr( 0, 1 ) !=
122
         "." )  // Let's make sure they didn't try using this method
123
    {
124
      IncludeDirectory = MyPath + IncludeDirectory;
125
    }
126
  }
127
  if ( ModuleDirectory.find( ':' ) == std::string::npos )
128
  {
129
    if ( ModuleDirectory.substr( 0, 1 ) !=
130
         "." )  // Let's make sure they didn't try using this method
131
    {
132
      ModuleDirectory = MyPath + ModuleDirectory;
133
    }
134
  }
135
  if ( PolScriptRoot.find( ':' ) == std::string::npos )
136
  {
137
    if ( PolScriptRoot.substr( 0, 1 ) != "." )  // Let's make sure they didn't try using this method
138
    {
139
      PolScriptRoot = MyPath + PolScriptRoot;
140
    }
141
  }
142
  for ( unsigned pr = 0; pr < PackageRoot.size(); ++pr )
143
  {
144
    if ( PackageRoot[pr].find( ':' ) == std::string::npos )
145
    {
146
      if ( PackageRoot[pr].substr( 0, 1 ) !=
147
           "." )  // Let's make sure they didn't try using this method
148
      {
149
        PackageRoot[pr] = MyPath + PackageRoot[pr];
150
      }
151
    }
152
  }
153

154
#endif
155
}
2,956✔
156

UNCOV
157
void CompilerConfig::SetDefaults()
×
158
{
159
  const char* tmp;
160

UNCOV
161
  tmp = getenv( "ECOMPILE_PATH_EM" );
×
162
  ModuleDirectory = tmp ? Clib::normalized_dir_form( tmp ) : PROG_CONFIG::programDir();
×
163

UNCOV
164
  tmp = getenv( "ECOMPILE_PATH_INC" );
×
165
  IncludeDirectory = tmp ? Clib::normalized_dir_form( tmp ) : PROG_CONFIG::programDir();
×
166

167
  PolScriptRoot = IncludeDirectory;
×
168

169
  DisplayUpToDateScripts = true;
×
170

171
  EmParseTreeCacheSize = 25;
×
UNCOV
172
  IncParseTreeCacheSize = 50;
×
UNCOV
173
}
×
174

175
CompilerConfig compilercfg;
176
}  // namespace Pol::Bscript
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