Packages

Tree-sitter bindings (nif) for elixir. Currently small subset of the tree-sitter api is supported, but happy to accept merge requests/patches

Current section

Files

Jump to
treesitter_elixir lib treesitter node.ex
Raw

lib/treesitter/node.ex

defmodule TreeSitter.Node do
@doc """
Extract the content of the node from the given source_code/content
"""
def content(node, content) do
{s, e} = TreeSitter.Nif.node_byte_range(node)
Kernel.binary_part(content, s, e - s)
end
end