Skip to content

Commit 7715001

Browse files
ObserverOfTimeamaanq
authored andcommitted
build: tune compiler warnings
1 parent 20c2783 commit 7715001

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ add_library(tree-sitter ${TS_SOURCE_FILES})
2121

2222
target_include_directories(tree-sitter PRIVATE src src/wasm include)
2323

24-
if(NOT MSVC)
25-
target_compile_options(tree-sitter PRIVATE -Wall -Wextra -Wshadow -Wno-unused-parameter -pedantic)
24+
if(MSVC)
25+
target_compile_options(tree-sitter PRIVATE /W4 /wd4018 /wd4701 /wd4702 /wd4100 /wd4232 /wd4244)
26+
else()
27+
target_compile_options(tree-sitter PRIVATE -Wall -Wextra -Wshadow -pedantic)
2628
endif()
2729

2830
if(TREE_SITTER_FEATURE_WASM)

lib/src/parser.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static bool ts_parser__call_main_lex_fn(TSParser *self, TSLexMode lex_mode) {
348348
}
349349
}
350350

351-
static bool ts_parser__call_keyword_lex_fn(TSParser *self, TSLexMode lex_mode) {
351+
static bool ts_parser__call_keyword_lex_fn(TSParser *self) {
352352
if (ts_language_is_wasm(self->language)) {
353353
return ts_wasm_store_call_lex_keyword(self->wasm_store, 0);
354354
} else {
@@ -649,7 +649,7 @@ static Subtree ts_parser__lex(
649649
ts_lexer_reset(&self->lexer, self->lexer.token_start_position);
650650
ts_lexer_start(&self->lexer);
651651

652-
is_keyword = ts_parser__call_keyword_lex_fn(self, lex_mode);
652+
is_keyword = ts_parser__call_keyword_lex_fn(self);
653653

654654
if (
655655
is_keyword &&

0 commit comments

Comments
 (0)