diff options
-rw-r--r-- | parameter/RuleParser.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/parameter/RuleParser.cpp b/parameter/RuleParser.cpp index b72556b..0258adf 100644 --- a/parameter/RuleParser.cpp +++ b/parameter/RuleParser.cpp @@ -121,8 +121,20 @@ bool CRuleParser::parse(CCompoundRule* pParentRule, string& strError) // Go on break; } - case EDone: - return true; + case EDone: { + // If the current state is EDone, check that at least one rule has been found. + if (_pRootRule) { + + // At least one rule found + return true; + } else { + + strError = "Syntax error, no rule found"; + + return false; + } + + } default: assert(0); return false; |