Fix build warnings
This commit is contained in:
parent
6cf4ccb840
commit
5332fd3418
4 changed files with 16 additions and 9 deletions
|
|
@ -321,7 +321,7 @@ class ParseTableBuilder {
|
|||
if (state_replacements.count(i)) {
|
||||
state_indices_by_signature[state.shift_actions_signature].erase(i);
|
||||
} else {
|
||||
state.each_referenced_state([&state_replacements](int64_t *state_index) {
|
||||
state.each_referenced_state([&state_replacements](ParseStateId *state_index) {
|
||||
auto replacement = state_replacements.find(*state_index);
|
||||
if (replacement != state_replacements.end()) {
|
||||
*state_index = replacement->second;
|
||||
|
|
@ -349,7 +349,7 @@ class ParseTableBuilder {
|
|||
iter = parse_table.states.erase(iter);
|
||||
} else {
|
||||
ParseState &state = *iter;
|
||||
state.each_referenced_state([&new_state_ids](int64_t *state_index) {
|
||||
state.each_referenced_state([&new_state_ids](ParseStateId *state_index) {
|
||||
*state_index = new_state_ids[*state_index];
|
||||
});
|
||||
++iter;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace tree_sitter {
|
||||
|
||||
typedef int64_t ParseStateId;
|
||||
typedef size_t ParseStateId;
|
||||
|
||||
enum ParseActionType {
|
||||
ParseActionTypeError,
|
||||
|
|
|
|||
|
|
@ -82,13 +82,17 @@ static void ts_lexer__advance(void *payload, TSStateId state, bool skip) {
|
|||
|
||||
void ts_lexer_init(Lexer *self) {
|
||||
*self = (Lexer){
|
||||
.data =
|
||||
{
|
||||
.advance = ts_lexer__advance, .lookahead = 0, .result_symbol = 0,
|
||||
},
|
||||
.data = {
|
||||
.advance = ts_lexer__advance,
|
||||
.lookahead = 0,
|
||||
.result_symbol = 0,
|
||||
},
|
||||
.chunk = NULL,
|
||||
.chunk_start = 0,
|
||||
.logger = {},
|
||||
.logger = {
|
||||
.payload = NULL,
|
||||
.log = NULL
|
||||
},
|
||||
};
|
||||
ts_lexer_reset(self, length_zero());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,11 @@ Tree *ts_tree_make_leaf(TSSymbol sym, Length padding, Length size,
|
|||
.padding = padding,
|
||||
.visible = metadata.visible,
|
||||
.named = metadata.named,
|
||||
.first_leaf.symbol = sym,
|
||||
.has_changes = false,
|
||||
.first_leaf = {
|
||||
.symbol = sym,
|
||||
.lex_state = 0
|
||||
}
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue