astgen: fix fnProtoExprInner lparen computation for named fn protos

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 03:23:19 +00:00
parent fa3232cc1d
commit a80960d00a

View File

@@ -6587,7 +6587,7 @@ static uint32_t fnProtoExprInner(
uint32_t return_type_rhs = proto_data.rhs;
if (proto_tag == AST_NODE_FN_PROTO_SIMPLE) {
if (proto_data.lhs != 0) {
if (proto_data.lhs != NULL_NODE) {
param_nodes_buf[0] = proto_data.lhs;
param_nodes = param_nodes_buf;
params_len = 1;
@@ -6595,7 +6595,7 @@ static uint32_t fnProtoExprInner(
} else if (proto_tag == AST_NODE_FN_PROTO_ONE) {
uint32_t extra_idx = proto_data.lhs;
uint32_t param = tree->extra_data.arr[extra_idx];
if (param != 0) {
if (param != NULL_NODE) {
param_nodes_buf[0] = param;
param_nodes = param_nodes_buf;
params_len = 1;
@@ -6628,7 +6628,10 @@ static uint32_t fnProtoExprInner(
bool is_var_args = false;
uint32_t fn_token = tree->nodes.main_tokens[node];
uint32_t lparen = fn_token + 1;
uint32_t after_fn_token = fn_token + 1;
uint32_t lparen = (tree->tokens.tags[after_fn_token] == TOKEN_IDENTIFIER)
? after_fn_token + 1
: after_fn_token;
uint32_t iter_tok_i = lparen + 1;
bool iter_tok_flag = true;
uint32_t iter_param_i = 0;