aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Conf.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp
index c487e28..27713d8 100644
--- a/src/Conf.cpp
+++ b/src/Conf.cpp
@@ -494,6 +494,14 @@ namespace sibs
validatePackageName();
}
+ else if(name.equals("version"))
+ {
+ // TODO: Use version for info output when building
+ }
+ else if(name.equals("authors"))
+ {
+ // TODO: Use authors for something?
+ }
else if(name.equals("type"))
{
if (value.isSingle())
@@ -618,6 +626,8 @@ namespace sibs
else
throw ParserException("Expected package.ignore_dirs to be a list, was a single value");
}
+ else
+ failInvalidFieldUnderObject(name);
}
else if(currentObject.equals("config"))
{
@@ -638,6 +648,8 @@ namespace sibs
throw ParserException(errMsg);
}
}
+ else
+ failInvalidFieldUnderObject(name);
}
else if (currentObject.equals(CONFIG_SYSTEM_PLATFORM))
{
@@ -658,6 +670,8 @@ namespace sibs
throw ParserException(errMsg);
}
}
+ else
+ failInvalidFieldUnderObject(name);
}
else if (currentObject.equals(CONFIG_STATIC_DEBUG_PLATFORM))
{
@@ -678,6 +692,8 @@ namespace sibs
throw ParserException(errMsg);
}
}
+ else
+ failInvalidFieldUnderObject(name);
}
else if (currentObject.equals(CONFIG_STATIC_RELEASE_PLATFORM))
{
@@ -698,6 +714,8 @@ namespace sibs
throw ParserException(errMsg);
}
}
+ else
+ failInvalidFieldUnderObject(name);
}
else if(currentObject.equals("dependencies"))
{
@@ -712,6 +730,13 @@ namespace sibs
else
throw ParserException("Expected field under dependencies to be a single value, was a list");
}
+ else
+ {
+ string errMsg = "Invalid config object \"";
+ errMsg += string(currentObject.data, currentObject.size);
+ errMsg += "\"";
+ throw ParserException(errMsg);
+ }
}
void SibsConfig::finished()
@@ -734,7 +759,17 @@ namespace sibs
throw ParserException(errMsg);
}
}
-
+
+ void SibsConfig::failInvalidFieldUnderObject(const StringView &fieldName) const
+ {
+ string errMsg = "Invalid field \"";
+ errMsg += string(fieldName.data, fieldName.size);
+ errMsg += "\" under object \"";
+ errMsg += string(currentObject.data, currentObject.size);
+ errMsg += "\"";
+ throw ParserException(errMsg);
+ }
+
void SibsTestConfig::processObject(StringView name)
{
currentObject = name;