Skip to content

Commit

Permalink
Fix ruby attribute scanner ignoring characters
Browse files Browse the repository at this point in the history
  • Loading branch information
kolen committed Jul 4, 2024
1 parent b7f57dd commit 18f1915
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static bool scan_attr_ruby(TSLexer *lexer, char closing_delimiter, TSSymbol resu
for(;;) {
if (lexer->lookahead == '\n') {
if (line_continuation) {
lexer->advance(lexer, true);
lexer->advance(lexer, false);
continue;
} else {
break;
Expand All @@ -151,14 +151,14 @@ static bool scan_attr_ruby(TSLexer *lexer, char closing_delimiter, TSSymbol resu
}
} else if (lexer->lookahead == ' ' || lexer->lookahead == '\t') {
if (line_continuation) {
lexer->advance(lexer, true);
lexer->advance(lexer, false);
continue;
} else if (!internal_delimiter_nesting) {
break;
}
} else if (lexer->lookahead == '\\' || lexer->lookahead == ',') {
line_continuation = true;
lexer->advance(lexer, true);
lexer->advance(lexer, false);
continue;
} else if (lexer->lookahead == ' ' || lexer->lookahead == '\t') {
if (!line_continuation && !internal_delimiter_nesting) {
Expand Down Expand Up @@ -193,7 +193,7 @@ static bool scan_attr_ruby(TSLexer *lexer, char closing_delimiter, TSSymbol resu
}

line_continuation = false;
lexer->advance(lexer, true);
lexer->advance(lexer, false);
}

if (internal_delimiter_nesting) {
Expand Down

0 comments on commit 18f1915

Please sign in to comment.