summaryrefslogtreecommitdiffstats
path: root/src/dbusxmlscanner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dbusxmlscanner.cpp')
-rw-r--r--src/dbusxmlscanner.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/dbusxmlscanner.cpp b/src/dbusxmlscanner.cpp
index 8a07d81..514039f 100644
--- a/src/dbusxmlscanner.cpp
+++ b/src/dbusxmlscanner.cpp
@@ -354,6 +354,7 @@ public:
// Interface:
if (DBUS("interface"))
{
+ CONDITION(m_currentInterface, "end of interface found without start.");
m_currentInterface->endBodyLine = lineNumber();
closeScopes();
m_currentInterface = 0;
@@ -361,6 +362,8 @@ public:
if (DBUS("method") || DBUS("signal"))
{
+ CONDITION(m_currentMethod, "end of method found without start.");
+ CONDITION(m_currentInterface, "end of method found outside interface.");
m_currentMethod->endBodyLine = lineNumber();
m_currentInterface->addSubEntry(m_currentMethod);
m_currentMethod = 0;
@@ -368,6 +371,8 @@ public:
if (DBUS("property"))
{
+ CONDITION(m_currentMethod, "end of property found without start.");
+ CONDITION(m_currentInterface, "end of property found outside interface.");
m_currentProperty->endBodyLine = lineNumber();
m_currentInterface->addSubEntry(m_currentProperty);
m_currentProperty = 0;
@@ -375,6 +380,7 @@ public:
if (DBUS("arg"))
{
+ CONDITION(m_currentMethod, "end of arg found outside method.");
m_currentMethod->argList->append(m_currentArgument);
m_currentArgument = 0;
}
@@ -382,6 +388,7 @@ public:
if (EXTENSION("namespace"))
{
Entry * current = m_namespaceStack.last();
+ CONDITION(current, "end of namespace without start.");
m_namespaceStack.removeLast();
current->endBodyLine = lineNumber();
@@ -391,6 +398,7 @@ public:
if (EXTENSION("struct"))
{
StructData * data = m_structStack.last();
+ CONDITION(data, "end of struct without start.");
data->entry->endBodyLine = lineNumber();
@@ -408,11 +416,14 @@ public:
if (EXTENSION("member"))
{
- m_structStack.last()->entry->addSubEntry(m_currentEntry);
+ StructData * data = m_structStack.last();
+ CONDITION(data, "end of struct without start");
+ data->entry->addSubEntry(m_currentEntry);
}
if (EXTENSION("enum") || EXTENSION("flagset"))
{
+ CONDITION(m_currentEnum, "end of enum without start");
m_currentEnum->endBodyLine = lineNumber();
closeScopes();
@@ -421,6 +432,7 @@ public:
if (EXTENSION("value"))
{
+ CONDITION(m_currentEntry, "end of value without start");
m_currentEntry->endBodyLine = lineNumber();
m_currentEnum->addSubEntry(m_currentEntry);
@@ -847,7 +859,8 @@ void DBusXMLScanner::parseInput(const char * fileName,
reader.parse(inputSource);
if (handler.errorString())
- { err("ERROR parsing XML: %s\n", handler.errorString().utf8().data()); }
+ { err("DBus XML Parser: Error at line %d: %s\n",
+ handler.locator()->lineNumber(),handler.errorString().utf8().data()); }
groupLeaveFile(fileName, 1);
}