From 87d892d0a3797991f8e5c9ae9781c7dd1dd22968 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 21 Jul 2025 23:26:37 -0400 Subject: [PATCH] Fix a couple clang warnings --- assets/parser.c.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/parser.c.erb b/assets/parser.c.erb index f95ac75..cb9eb56 100644 --- a/assets/parser.c.erb +++ b/assets/parser.c.erb @@ -359,6 +359,7 @@ static size_t find_longest_match(<%= @grammar.prefix %>context_t * context, switch (result) { case P_SUCCESS: + { lexer_state_id_t transition_state = check_lexer_transition(current_state, code_point); if (transition_state != INVALID_LEXER_STATE_ID) { @@ -390,6 +391,7 @@ static size_t find_longest_match(<%= @grammar.prefix %>context_t * context, *out_unexpected_input_length = attempt_match.length + code_point_length; return P_UNEXPECTED_INPUT; } + } break; case P_EOF: @@ -456,6 +458,7 @@ static size_t attempt_lex_token(<%= @grammar.prefix %>context_t * context, <%= @ switch (result) { case P_SUCCESS: + { <%= @grammar.prefix %>token_t token_to_accept = match_info.accepting_state->token; if (match_info.accepting_state->code_id != INVALID_USER_CODE_ID) { @@ -507,6 +510,7 @@ static size_t attempt_lex_token(<%= @grammar.prefix %>context_t * context, <%= @ token_info.end_position.col = token_info.position.col + match_info.end_delta_position.col; } *out_token_info = token_info; + } return P_SUCCESS; case P_EOF: