array: allow omitting space after array dash when linebreak follows
This commit is contained in:
@@ -32,7 +32,8 @@ my_section
|
|||||||
```
|
```
|
||||||
|
|
||||||
Keys cannot contain spaces. Indents are always two spaces. There is one space
|
Keys cannot contain spaces. Indents are always two spaces. There is one space
|
||||||
between the hyphen and the value and an array. This is all.
|
between the hyphen and the value in an array, unless there is a linebreak
|
||||||
|
immediately after. This is all.
|
||||||
|
|
||||||
It is a simple format, some might think it is too simple. It is, however,
|
It is a simple format, some might think it is too simple. It is, however,
|
||||||
possible, to write a simple, fast implementation in a few hundred lines of C
|
possible, to write a simple, fast implementation in a few hundred lines of C
|
||||||
|
4
cfg.h
4
cfg.h
@@ -571,8 +571,8 @@ parsed_value config_parse_list(string* s, size_t* line, size_t* col, size_t inde
|
|||||||
*l =new_list_config_value();
|
*l =new_list_config_value();
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
if (s->str[0] != ' ') return config_value_parse_error("expected space to start list element", *line, *col);
|
if (s->str[0] != ' ' && s->str[0] != '\n') return config_value_parse_error("expected space to start list element", *line, *col);
|
||||||
s->str++;
|
if (s->str[0] == ' ') s->str++;
|
||||||
consumed += 1;
|
consumed += 1;
|
||||||
elem = config_parse_value(s, line, col, indent);
|
elem = config_parse_value(s, line, col, indent);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user