diff --git a/src/scanner.c b/src/scanner.c index 9e7a9a4..eac5cc4 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -109,7 +109,7 @@ static bool scan_raw_string_content(TSLexer *lexer, Scanner *s) { adv; uint8_t level = consume_chars(lexer, '#'); lexer->log(lexer, "Consumed [%i] #\n", level); - if (level == s->level && len != 0) { + if (level == s->level) { lexer->log(lexer, "Detected end\n" ); return true; } else if (level == s->level && len == 0) { diff --git a/test/corpus/decl/raw-strings.nu b/test/corpus/decl/raw-strings.nu index 0d59d35..8a49a9f 100644 --- a/test/corpus/decl/raw-strings.nu +++ b/test/corpus/decl/raw-strings.nu @@ -61,3 +61,19 @@ r#####'string '#'##'##### (raw_string_begin) (raw_string_content) (raw_string_end))))) + +===== +raw-strings-005-empty-string +===== + +r#''# + +----- + +(nu_script + (pipeline + (pipe_element + (val_string + (raw_string_begin) + (raw_string_content) + (raw_string_end)))))