From e7384a7672e4449bc194ca3ec66cdd4fcc63801e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 9 Dec 2017 16:36:23 +0100 Subject: Add support for dependencies (including version check) This currently only works using pkg-config and it only adds linking flags. Need to check with a library that also includes other types of flags. TODO: Fallback to dependencies sub directory and github/server if package not found in pkg-config. --- src/Conf.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/Conf.cpp') diff --git a/src/Conf.cpp b/src/Conf.cpp index 56b1e2a..6383c30 100644 --- a/src/Conf.cpp +++ b/src/Conf.cpp @@ -68,7 +68,7 @@ namespace sibs char *startOfIdentifier = code.base(); ++code; c = *code; - while(isAlpha(c) || c == '_' || isDigit(c)) + while(isAlpha(c) || isDigit(c) || c == '_' || c == '-') { ++code; c = *code; @@ -95,19 +95,21 @@ namespace sibs } else if(c == '"') { - u32 escapeCount = 0; + bool escapeQuote = false; ++code; char *startOfStr = code.base(); - while(escapeCount > 0 || *code != '"') + while(true) { c = *code; - if(c == '\0') - return Token::END_OF_FILE; + if(c == '"' && !escapeQuote) + break; else if(c == '\\') - ++escapeCount; + escapeQuote = !escapeQuote; + else if(c == '\0') + throw UnexpectedTokenException("Reached end of file before string end"); else - escapeCount = min(0, escapeCount - 1); + escapeQuote = false; ++code; } -- cgit v1.2.3