mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
Clean up the config parser a bit
This commit is contained in:
parent
1811f8689b
commit
93b66a0c4a
@ -212,7 +212,6 @@ static std::stack<TypeRuleList::Ptr> m_RuleLists;
|
|||||||
static ConfigType::Ptr m_Type;
|
static ConfigType::Ptr m_Type;
|
||||||
|
|
||||||
static Dictionary::Ptr m_ModuleScope;
|
static Dictionary::Ptr m_ModuleScope;
|
||||||
static int m_StatementNum;
|
|
||||||
|
|
||||||
static bool m_Apply;
|
static bool m_Apply;
|
||||||
static bool m_ObjectAssign;
|
static bool m_ObjectAssign;
|
||||||
@ -224,9 +223,6 @@ void ConfigCompiler::Compile(void)
|
|||||||
{
|
{
|
||||||
m_ModuleScope = make_shared<Dictionary>();
|
m_ModuleScope = make_shared<Dictionary>();
|
||||||
|
|
||||||
int parentStatementNum = m_StatementNum;
|
|
||||||
m_StatementNum = 0;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yyparse(this);
|
yyparse(this);
|
||||||
} catch (const ConfigError& ex) {
|
} catch (const ConfigError& ex) {
|
||||||
@ -235,8 +231,6 @@ void ConfigCompiler::Compile(void)
|
|||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
ConfigCompilerContext::GetInstance()->AddMessage(true, DiagnosticInformation(ex));
|
ConfigCompilerContext::GetInstance()->AddMessage(true, DiagnosticInformation(ex));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_StatementNum = parentStatementNum;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define scanner (context->GetScanner())
|
#define scanner (context->GetScanner())
|
||||||
@ -249,9 +243,7 @@ statements: /* empty */
|
|||||||
;
|
;
|
||||||
|
|
||||||
statement: type | include | include_recursive | library | constant
|
statement: type | include | include_recursive | library | constant
|
||||||
{
|
{ }
|
||||||
m_StatementNum++;
|
|
||||||
}
|
|
||||||
| newlines
|
| newlines
|
||||||
{ }
|
{ }
|
||||||
| lterm
|
| lterm
|
||||||
@ -259,8 +251,6 @@ statement: type | include | include_recursive | library | constant
|
|||||||
Expression::Ptr aexpr = *$1;
|
Expression::Ptr aexpr = *$1;
|
||||||
aexpr->Evaluate(m_ModuleScope);
|
aexpr->Evaluate(m_ModuleScope);
|
||||||
delete $1;
|
delete $1;
|
||||||
|
|
||||||
m_StatementNum++;
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user