Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Jul 5, 2024
1 parent 04fd122 commit ff980db
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ static bool scan_template_chars(TSLexer *lexer) {
}

enum WhitespaceResult {
REJECT, // Semicolon is illegal, ie a syntax error occurred
REJECT, // Semicolon is illegal, ie a syntax error occurred
NO_NEWLINE, // Unclear if semicolon will be legal, continue
ACCEPT, // Semicolon is legal, assuming a comment was encountered
ACCEPT, // Semicolon is legal, assuming a comment was encountered
};

/**
Expand Down Expand Up @@ -83,14 +83,13 @@ static enum WhitespaceResult scan_whitespace_and_comments(TSLexer *lexer, bool *
skip(lexer);
*scanned_comment = true;

if(lexer->lookahead != '/' && !consume){
if (lexer->lookahead != '/' && !consume) {
return saw_block_newline ? ACCEPT : NO_NEWLINE;
}

break;
}
} else if (lexer->lookahead == '\n' || lexer->lookahead == 0x2028 ||
lexer->lookahead == 0x2029) {
} else if (lexer->lookahead == '\n' || lexer->lookahead == 0x2028 || lexer->lookahead == 0x2029) {
saw_block_newline = true;
skip(lexer);
} else {
Expand All @@ -115,7 +114,6 @@ static bool scan_automatic_semicolon(TSLexer *lexer, bool comment_condition, boo
return true;
}


if (lexer->lookahead == '/') {
enum WhitespaceResult result = scan_whitespace_and_comments(lexer, scanned_comment, false);
if (result == REJECT) {
Expand All @@ -125,7 +123,6 @@ static bool scan_automatic_semicolon(TSLexer *lexer, bool comment_condition, boo
if (result == ACCEPT && comment_condition && lexer->lookahead != ',' && lexer->lookahead != '=') {
return true;
}

}

if (lexer->lookahead == '}') {
Expand All @@ -149,8 +146,6 @@ static bool scan_automatic_semicolon(TSLexer *lexer, bool comment_condition, boo

skip(lexer);



if (scan_whitespace_and_comments(lexer, scanned_comment, true) == REJECT) {
return false;
}
Expand Down

0 comments on commit ff980db

Please sign in to comment.