Clean up the config parser a bit

This commit is contained in:
Gunnar Beutner 2014-11-01 05:23:14 +01:00
parent 1811f8689b
commit 93b66a0c4a
1 changed files with 1 additions and 11 deletions

View File

@ -212,7 +212,6 @@ static std::stack<TypeRuleList::Ptr> m_RuleLists;
static ConfigType::Ptr m_Type;
static Dictionary::Ptr m_ModuleScope;
static int m_StatementNum;
static bool m_Apply;
static bool m_ObjectAssign;
@ -224,9 +223,6 @@ void ConfigCompiler::Compile(void)
{
m_ModuleScope = make_shared<Dictionary>();
int parentStatementNum = m_StatementNum;
m_StatementNum = 0;
try {
yyparse(this);
} catch (const ConfigError& ex) {
@ -235,8 +231,6 @@ void ConfigCompiler::Compile(void)
} catch (const std::exception& ex) {
ConfigCompilerContext::GetInstance()->AddMessage(true, DiagnosticInformation(ex));
}
m_StatementNum = parentStatementNum;
}
#define scanner (context->GetScanner())
@ -249,9 +243,7 @@ statements: /* empty */
;
statement: type | include | include_recursive | library | constant
{
m_StatementNum++;
}
{ }
| newlines
{ }
| lterm
@ -259,8 +251,6 @@ statement: type | include | include_recursive | library | constant
Expression::Ptr aexpr = *$1;
aexpr->Evaluate(m_ModuleScope);
delete $1;
m_StatementNum++;
}
;