core: add single space where it is due

This commit is contained in:
2020-04-26 18:13:47 +02:00
parent 21272b290f
commit a13a8cfa8c
3 changed files with 16 additions and 6 deletions

8
cfg.h
View File

@@ -425,9 +425,9 @@ string config_value_str(config_value* c, size_t indent) {
for (i = 0; i < c->l->len; i++) {
string_cappend(&res, "\n");
for (j = 0; j < indent; j++) string_cappend(&res, " ");
string_cappend(&res, " -");
string_cappend(&res, " - ");
val = list_nth_config_value(c->l, i);
sub = config_value_str(&val, 0);
sub = config_value_str(&val, indent+2);
string_append(&res, &sub);
free_string(sub);
}
@@ -571,6 +571,9 @@ parsed_value config_parse_list(string* s, size_t* line, size_t* col, size_t inde
*l =new_list_config_value();
while(true) {
if (s->str[0] != ' ') return config_value_parse_error("expected space to start list element", *line, *col);
s->str++;
consumed += 1;
elem = config_parse_value(s, line, col, indent);
if (!elem.ok) return elem;
@@ -579,6 +582,7 @@ parsed_value config_parse_list(string* s, size_t* line, size_t* col, size_t inde
consumed += elem.consumed;
s->str += elem.consumed;
if (s->str[0] == '\0') break;
if (!config_parse_line(s, line, col)) return config_value_parse_error("expected newline", *line, *col);
ind = config_parse_indent(s, col);