aboutsummaryrefslogtreecommitdiff
path: root/src/Conf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Conf.cpp')
-rw-r--r--src/Conf.cpp40
1 files changed, 37 insertions, 3 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp
index 543c8d9..c2302e4 100644
--- a/src/Conf.cpp
+++ b/src/Conf.cpp
@@ -1125,9 +1125,13 @@ namespace sibs
{
cVersion = CVersion::C11;
}
+ else if(cVersionStr.equals("c20"))
+ {
+ cVersion = CVersion::C20;
+ }
else
{
- string errMsg = "Expected lang.c.version to be ansi, c89, c99 or c11, was ";
+ string errMsg = "Expected lang.c.version to be ansi, c89, c99, c11, c20, was ";
errMsg += string(cVersionStr.data, cVersionStr.size);
throw ParserException(errMsg);
}
@@ -1147,7 +1151,15 @@ namespace sibs
if(fieldValue.isSingle())
{
const StringView &cppVersionStr = fieldValue.asSingle();
- if(cppVersionStr.equals("c++11"))
+ if(cppVersionStr.equals("c++03"))
+ {
+ cppVersion = CPPVersion::CPP03;
+ }
+ else if(cppVersionStr.equals("c++98"))
+ {
+ cppVersion = CPPVersion::CPP98;
+ }
+ else if(cppVersionStr.equals("c++11"))
{
cppVersion = CPPVersion::CPP11;
}
@@ -1159,9 +1171,13 @@ namespace sibs
{
cppVersion = CPPVersion::CPP17;
}
+ else if(cppVersionStr.equals("c++20"))
+ {
+ cppVersion = CPPVersion::CPP20;
+ }
else
{
- string errMsg = "Expected lang.cpp.version to be c++11, c++14 or c++17, was ";
+ string errMsg = "Expected lang.cpp.version to be c++03, c++98, c++11, c++14, c++17 or c++20, was ";
errMsg += string(cppVersionStr.data, cppVersionStr.size);
throw ParserException(errMsg);
}
@@ -1169,6 +1185,24 @@ namespace sibs
else
throw ParserException("Expected lang.cpp.version to be a single value, was a list");
}
+ else if(fieldName.equals("enable_exceptions"))
+ {
+ if (fieldValue.isSingle())
+ {
+ StringView value_str = fieldValue.asSingle();
+ bool value_bool = false;
+ if(value_str.equals("true"))
+ value_bool = true;
+ else if(value_str.equals("false"))
+ value_bool = false;
+ else
+ throw ParserException("Expected " + string(currentObject.data, currentObject.size) + ".enable_exceptions to be either true or false");
+
+ enableExceptions = value_bool;
+ }
+ else
+ throw ParserException("Expected " + string(currentObject.data, currentObject.size) + ".enable_exceptions to be a single value, was a list");
+ }
else
failInvalidFieldUnderObject(fieldName);
}