Skip to content

Commit

Permalink
Amend scanner.c scan_string_content
Browse files Browse the repository at this point in the history
  • Loading branch information
Yosef Alsuhaibani authored and Yosef Alsuhaibani committed Aug 1, 2024
1 parent 100d79f commit fe7fd8d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ static bool scan_string_content(TSLexer *lexer, Stack *stack) {
// which leaves the possibility that it is an interpolation
if (lexer->lookahead == '$') {
advance(lexer);
// however this leaves an edgecase where an escaped dollar sign could
// appear at the end of a string (e.g "aa\$") which isn't handled
// correctly; if we were at the end of the string, terminate properly
if (lexer->lookahead == end_char) {
pop(stack);
advance(lexer);
mark_end(lexer);
lexer->result_symbol = STRING_END;
return true;
}
}
} else if (lexer->lookahead == end_char) {
if (is_triple) {
Expand Down

0 comments on commit fe7fd8d

Please sign in to comment.