diff -r 3df9258cd3cc -r 6440171c257f src/server/config/serverconfig.c --- a/src/server/config/serverconfig.c Sat Nov 12 11:52:47 2022 +0100 +++ b/src/server/config/serverconfig.c Sat Nov 12 12:09:37 2022 +0100 @@ -49,6 +49,7 @@ memset(&parser, 0, sizeof(ConfigParser2)); parser.mp = mp; parser.allow_hierarchy = true; + parser.delim = ""; ConfigNode *root = serverconfig_load_file(&parser, file); if(!root) { cxMempoolDestroy(mp); @@ -96,17 +97,17 @@ return root; } -static int scfg_char_is_delim(char c) { - static const char *scfg_tokenizer_delim = "()/*%"; - for(int i=0;idelim); + for(int i=0;idelim[i]) { return 1; } } return 0; } -static CFGToken get_next_token(cxstring content, int *pos) { +static CFGToken get_next_token(ConfigParser2 *parser, cxstring content, int *pos) { CFGToken token = { {NULL, 0}, CFG_NO_TOKEN }; CFGTokenType type = CFG_TOKEN; @@ -164,7 +165,7 @@ if(token_begin < 0) { token_begin = i; } - } else if(scfg_char_is_delim(c)) { + } else if(scfg_char_is_delim(parser, c)) { if(token_begin >= 0) { token_end = i; i--; @@ -248,6 +249,10 @@ CxMempool *mp = parser->mp; CxAllocator *a = (CxAllocator*)mp->allocator; + if(!parser->delim) { + parser->delim = ""; + } + // PARSE: // first non space/comment token is directive/object name // following tokens are arguments @@ -271,7 +276,7 @@ int text_start = 0; int err = 0; - while((token = get_next_token(content, &pos)).type != CFG_NO_TOKEN) { + while((token = get_next_token(parser, content, &pos)).type != CFG_NO_TOKEN) { //printf("%s [%.*s]\n", token_type_str(token.type), (int)token.content.length, token.content.ptr); switch(token.type) {