Skip to content

Commit

Permalink
fix: silence warning about using && without parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Mar 18, 2024
1 parent 0797931 commit b1f0c82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/parser.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "tree_sitter/parser.h"

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif

Expand Down Expand Up @@ -2250,11 +2249,15 @@ bool tree_sitter_html_external_scanner_scan(void *, TSLexer *, const bool *);
unsigned tree_sitter_html_external_scanner_serialize(void *, char *);
void tree_sitter_html_external_scanner_deserialize(void *, const char *, unsigned);

#ifdef _WIN32
#define extern __declspec(dllexport)
#ifdef TREE_SITTER_HIDE_SYMBOLS
#define TS_PUBLIC
#elif defined(_WIN32)
#define TS_PUBLIC __declspec(dllexport)
#else
#define TS_PUBLIC __attribute__((visibility("default")))
#endif

extern const TSLanguage *tree_sitter_html(void) {
TS_PUBLIC const TSLanguage *tree_sitter_html() {
static const TSLanguage language = {
.version = LANGUAGE_VERSION,
.symbol_count = SYMBOL_COUNT,
Expand Down
6 changes: 3 additions & 3 deletions src/scanner.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "tree_sitter/array.h"
#include "tag.h"
#include "tree_sitter/array.h"
#include <wctype.h>

enum TokenType {
START_TAG_NAME,
Expand Down Expand Up @@ -219,7 +219,7 @@ static bool scan_implicit_end_tag(Scanner *scanner, TSLexer *lexer) {
parent &&
(
!tag_can_contain(parent, &next_tag) ||
(parent->type == HTML || parent->type == HEAD || parent->type == BODY) && lexer->eof(lexer)
((parent->type == HTML || parent->type == HEAD || parent->type == BODY) && lexer->eof(lexer))
)
) {
pop_tag(scanner);
Expand Down

0 comments on commit b1f0c82

Please sign in to comment.