Allow lisp-style comments in tree queries
This commit is contained in:
parent
4fa0b02d67
commit
33f89522f6
2 changed files with 73 additions and 33 deletions
|
|
@ -147,7 +147,18 @@ static Stream stream_new(const char *string, uint32_t length) {
|
|||
}
|
||||
|
||||
static void stream_skip_whitespace(Stream *stream) {
|
||||
while (iswspace(stream->next)) stream_advance(stream);
|
||||
for (;;) {
|
||||
if (iswspace(stream->next)) {
|
||||
stream_advance(stream);
|
||||
} else if (stream->next == ';') {
|
||||
stream_advance(stream);
|
||||
while (stream->next && stream->next != '\n') {
|
||||
if (!stream_advance(stream)) break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool stream_is_ident_start(Stream *stream) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue