Learn R Programming

treesitter.c (version 0.0.4.2)

get_function_nodes: Extract function names (declarations and definitions) from a root

Description

Returns a data frame with capture_name, text, start_line, and start_col.

Usage

get_function_nodes(root, extract_params = FALSE, extract_return = FALSE)

Value

Data frame with function captures; when extract_params=TRUE a params list-column is present.

Arguments

root

A tree-sitter root node.

extract_params

Logical; whether to extract parameter types for found functions. Default FALSE.

extract_return

Logical; whether to extract return types for found functions. Default FALSE.