Closed riusksk closed 9 months ago
It does parse correctly, if you're including those line numbers when parsing then that's your issue
It does parse correctly, if you're including those line numbers when parsing then that's your issue
The code does not include line numbers; I'm just providing an example with corresponding line numbers. You can try parsing the file: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/io_uring/filetable.c?id=9d94c04c0db024922e886c9fd429659f22f48ea4 to see if tree_sitter_c can recognize the io_install_fixed_file
function.
static int io_install_fixed_file(struct io_ring_ctx *ctx, struct file *file,
u32 slot_index)
__must_hold(&req->ctx->uring_lock)
{
...
}
and this eap_request
function
static void
eap_request(esp, inp, id, len)
eap_state *esp;
u_char *inp;
int id;
int len;
{
...
}
They can't recognize the starting and ending ranges of functions properly.
The above two functions are identified as function_definition, and the corresponding function definitions have line number ranges of 1718 ~ 2008 and 60 ~ 107, respectively.
for example:
The node types identified by tree-sitter are as follows:
Failed to recognize function_definition
eap_request