From 5e9b850672cccb8ecf20196c313727932c977856 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 1 Jan 2018 09:48:13 +0100 Subject: Add support for comments in config file --- src/Conf.cpp | 13 +++++++++++++ tests/src/confTest/validProject.conf | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) 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"] -- cgit v1.2.3