Skip to content

Commit

Permalink
tokenize the string #" ""# correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
tjol committed Dec 7, 2024
1 parent 4647ce3 commit 0ce97d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,12 @@ static kdl_tokenizer_status _pop_string(kdl_tokenizer* self, kdl_token* dest)
if (quotes_found == 0) {
end_quote_offset = cur - self->document.data;
}
++quotes_found;
if (quotes_found < initial_quote_count) {
++quotes_found;
} else {
// possibly extra quotes at the end of a raw string.
++end_quote_offset;
}
hashes_found = 0;
} else if (c == '#' && (hashes_found != 0 || quotes_found == initial_quote_count)) {
++hashes_found;
Expand Down

0 comments on commit 0ce97d5

Please sign in to comment.