From 93b66a0c4aa8af7a429e3230983640fa99404e01 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 1 Nov 2014 05:23:14 +0100 Subject: [PATCH] Clean up the config parser a bit --- lib/config/config_parser.yy | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy index 838a1ed6f..5a7ba880e 100644 --- a/lib/config/config_parser.yy +++ b/lib/config/config_parser.yy @@ -212,7 +212,6 @@ static std::stack 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(); - 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++; } ; -- 2.40.0