diff --git a/parser-specs/config.spec b/parser-specs/config.spec index 6960510d..c6328a0e 100644 --- a/parser-specs/config.spec +++ b/parser-specs/config.spec @@ -49,7 +49,7 @@ state INITIAL: # We ignore comments and 'set' lines (variables). state IGNORE_LINE: - end, string + line -> INITIAL # floating_minimum_size x @@ -311,7 +311,7 @@ state MODE: # We ignore comments and 'set' lines (variables). state MODE_IGNORE_LINE: - end, string + line -> MODE state MODE_BINDING: @@ -362,7 +362,7 @@ state BAR: # We ignore comments and 'set' lines (variables). state BAR_IGNORE_LINE: - end, string + line -> BAR state BAR_BAR_COMMAND: @@ -428,7 +428,7 @@ state BAR_COLORS: # We ignore comments and 'set' lines (variables). state BAR_COLORS_IGNORE_LINE: - end, string + line -> BAR_COLORS state BAR_COLORS_SINGLE: diff --git a/src/config_parser.c b/src/config_parser.c index 1cdc7acb..f197c39d 100644 --- a/src/config_parser.c +++ b/src/config_parser.c @@ -446,6 +446,16 @@ struct ConfigResult *parse_config(const char *input, struct context *context) { } } + if (strcmp(token->name, "line") == 0) { + while (*walk != '\0' && *walk != '\n' && *walk != '\r') + walk++; + next_state(token); + token_handled = true; + linecnt++; + walk++; + break; + } + if (strcmp(token->name, "end") == 0) { //printf("checking for end: *%s*\n", walk); if (*walk == '\0' || *walk == '\n' || *walk == '\r') {