aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-01-01 09:48:13 +0100
committerdec05eba <dec05eba@protonmail.com>2018-01-01 09:48:18 +0100
commit5e9b850672cccb8ecf20196c313727932c977856 (patch)
tree69086a9cee7e11d07ac1f8c4622695fcac151ea1
parent1f6ee990275f412d4cc84483051fd549710da634 (diff)
Add support for comments in config file
-rw-r--r--src/Conf.cpp13
-rw-r--r--tests/src/confTest/validProject.conf3
2 files changed, 15 insertions, 1 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp
index 39a8c1d..2d7db93 100644
--- a/src/Conf.cpp
+++ b/src/Conf.cpp
@@ -122,6 +122,19 @@ namespace sibs
++code;
return Token::COMMA;
}
+ else if(c == '#')
+ {
+ ++code;
+ while(true)
+ {
+ c = *code;
+ if(c == '\n')
+ return nextToken();
+ else if(c == '\0')
+ return Token::END_OF_FILE;
+ ++code;
+ }
+ }
else if(c == '\0')
{
return Token::END_OF_FILE;
diff --git a/tests/src/confTest/validProject.conf b/tests/src/confTest/validProject.conf
index eab258b..cd3f9cc 100644
--- a/tests/src/confTest/validProject.conf
+++ b/tests/src/confTest/validProject.conf
@@ -5,9 +5,10 @@ type = "library"
platforms = ["linux64", "win64"]
[dependencies]
-xxhash = "0.1.0"
+xxhash = "0.1.0" # random comment at end of line
catch2 = "1.0.0"
+# cmake building is currrently not implemented, but it is intended to work like this
[cmake]
dir = "cmakeGlobal"
args = ["ENTITYX_RUN_BENCHMARKS=0"]