Skip to content

Commit

Permalink
chore: clang tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Jan 24, 2024
1 parent 16874f1 commit ff82725
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/scanner.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "tree_sitter/parser.h"

#include <assert.h>
#include <string.h>
#include <tree_sitter/parser.h>
#include <wctype.h>

enum TokenType { RAW_STRING_DELIMITER, RAW_STRING_CONTENT };
Expand All @@ -25,8 +26,9 @@ static bool scan_raw_string_delimiter(Scanner *scanner, TSLexer *lexer) {
// We already checked this when scanning content, but this is how we
// know when to stop. We can't stop at ", because R"""hello""" is valid.
for (int i = 0; i < scanner->delimiter_length; ++i) {
if (lexer->lookahead != scanner->delimiter[i])
if (lexer->lookahead != scanner->delimiter[i]) {
return false;
}
advance(lexer);
}
reset(scanner);
Expand Down Expand Up @@ -68,9 +70,8 @@ static bool scan_raw_string_content(Scanner *scanner, TSLexer *lexer) {
if (delimiter_index == scanner->delimiter_length) {
if (lexer->lookahead == '"') {
return true;
} else {
delimiter_index = -1;
}
delimiter_index = -1;
} else {
if (lexer->lookahead == scanner->delimiter[delimiter_index]) {
delimiter_index++;
Expand Down

0 comments on commit ff82725

Please sign in to comment.