module TreeSitter ( Language, Node (..), Point (..), extract_comments, tree_sitter_bash, tree_sitter_beancount, tree_sitter_bibtex, tree_sitter_c, tree_sitter_c_sharp, tree_sitter_clojure, tree_sitter_cmake, tree_sitter_comment, tree_sitter_commonlisp, tree_sitter_cpp, tree_sitter_css, tree_sitter_cuda, tree_sitter_dart, tree_sitter_devicetree, tree_sitter_dockerfile, tree_sitter_dot, tree_sitter_eex, tree_sitter_elisp, tree_sitter_elixir, tree_sitter_elm, tree_sitter_embedded_template, tree_sitter_erlang, tree_sitter_fennel, tree_sitter_fish, tree_sitter_fortran, tree_sitter_gdscript, tree_sitter_glimmer, tree_sitter_glsl, tree_sitter_go, tree_sitter_godot_resource, tree_sitter_gomod, tree_sitter_gowork, tree_sitter_graphql, tree_sitter_haskell, tree_sitter_hcl, tree_sitter_heex, tree_sitter_hjson, tree_sitter_html, tree_sitter_http, tree_sitter_janet_simple, tree_sitter_java, tree_sitter_javascript, tree_sitter_jsdoc, tree_sitter_json, tree_sitter_json5, tree_sitter_jsonnet, tree_sitter_julia, tree_sitter_kotlin, tree_sitter_latex, tree_sitter_ledger, tree_sitter_llvm, tree_sitter_lua, tree_sitter_make, tree_sitter_markdown, tree_sitter_markdown_inline, tree_sitter_nickel, tree_sitter_nix, tree_sitter_norg, tree_sitter_nu, tree_sitter_ocaml, tree_sitter_ocaml_interface, tree_sitter_perl, tree_sitter_pgn, tree_sitter_php, tree_sitter_pioasm, tree_sitter_prisma, tree_sitter_pug, tree_sitter_python, tree_sitter_ql, tree_sitter_ql_dbscheme, tree_sitter_query, tree_sitter_r, tree_sitter_regex, tree_sitter_rego, tree_sitter_rst, tree_sitter_ruby, tree_sitter_rust, tree_sitter_scala, tree_sitter_scheme, tree_sitter_scss, tree_sitter_smithy, tree_sitter_solidity, tree_sitter_sparql, tree_sitter_sql, tree_sitter_supercollider, tree_sitter_surface, tree_sitter_svelte, tree_sitter_tiger, tree_sitter_tlaplus, tree_sitter_toml, tree_sitter_tsq, tree_sitter_tsx, tree_sitter_turtle, tree_sitter_typescript, tree_sitter_verilog, tree_sitter_vim, tree_sitter_vue, tree_sitter_yaml, tree_sitter_yang, tree_sitter_zig, ) where import Foreign.C.String (CString) import Foreign.C.Types (CInt (..)) import Foreign.Ptr (Ptr) import Foreign.Storable (Storable (..)) data Language data Node = Node { startPoint :: Point, endPoint :: Point, startByte :: CInt, endByte :: CInt } deriving (Show, Eq) instance Storable Node where alignment _ = 8 sizeOf _ = 24 peek ptr = Node <$> peekByteOff ptr 0 <*> peekByteOff ptr 8 <*> peekByteOff ptr 16 <*> peekByteOff ptr 20 poke ptr (Node {..}) = do pokeByteOff ptr 0 startPoint pokeByteOff ptr 8 endPoint pokeByteOff ptr 16 startByte pokeByteOff ptr 20 endByte data Point = Point { row :: CInt, column :: CInt } deriving (Show, Eq) instance Storable Point where alignment _ = 4 sizeOf _ = 8 peek ptr = Point <$> peekByteOff ptr 0 <*> peekByteOff ptr 4 poke ptr (Point {..}) = pokeByteOff ptr 0 row >> pokeByteOff ptr 4 column foreign import ccall unsafe "extract_comments" extract_comments :: Ptr Language -> CString -> Ptr (Ptr Node) -> Ptr CInt -> IO () foreign import ccall unsafe "tree_sitter_bash" tree_sitter_bash :: Ptr Language foreign import ccall unsafe "tree_sitter_beancount" tree_sitter_beancount :: Ptr Language foreign import ccall unsafe "tree_sitter_bibtex" tree_sitter_bibtex :: Ptr Language foreign import ccall unsafe "tree_sitter_clojure" tree_sitter_clojure :: Ptr Language foreign import ccall unsafe "tree_sitter_cmake" tree_sitter_cmake :: Ptr Language foreign import ccall unsafe "tree_sitter_comment" tree_sitter_comment :: Ptr Language foreign import ccall unsafe "tree_sitter_commonlisp" tree_sitter_commonlisp :: Ptr Language foreign import ccall unsafe "tree_sitter_cpp" tree_sitter_cpp :: Ptr Language foreign import ccall unsafe "tree_sitter_c_sharp" tree_sitter_c_sharp :: Ptr Language foreign import ccall unsafe "tree_sitter_css" tree_sitter_css :: Ptr Language foreign import ccall unsafe "tree_sitter_c" tree_sitter_c :: Ptr Language foreign import ccall unsafe "tree_sitter_cuda" tree_sitter_cuda :: Ptr Language foreign import ccall unsafe "tree_sitter_dart" tree_sitter_dart :: Ptr Language foreign import ccall unsafe "tree_sitter_devicetree" tree_sitter_devicetree :: Ptr Language foreign import ccall unsafe "tree_sitter_dockerfile" tree_sitter_dockerfile :: Ptr Language foreign import ccall unsafe "tree_sitter_dot" tree_sitter_dot :: Ptr Language foreign import ccall unsafe "tree_sitter_eex" tree_sitter_eex :: Ptr Language foreign import ccall unsafe "tree_sitter_elisp" tree_sitter_elisp :: Ptr Language foreign import ccall unsafe "tree_sitter_elixir" tree_sitter_elixir :: Ptr Language foreign import ccall unsafe "tree_sitter_elm" tree_sitter_elm :: Ptr Language foreign import ccall unsafe "tree_sitter_embedded_template" tree_sitter_embedded_template :: Ptr Language foreign import ccall unsafe "tree_sitter_erlang" tree_sitter_erlang :: Ptr Language foreign import ccall unsafe "tree_sitter_fennel" tree_sitter_fennel :: Ptr Language foreign import ccall unsafe "tree_sitter_fish" tree_sitter_fish :: Ptr Language foreign import ccall unsafe "tree_sitter_fortran" tree_sitter_fortran :: Ptr Language foreign import ccall unsafe "tree_sitter_gdscript" tree_sitter_gdscript :: Ptr Language foreign import ccall unsafe "tree_sitter_glimmer" tree_sitter_glimmer :: Ptr Language foreign import ccall unsafe "tree_sitter_glsl" tree_sitter_glsl :: Ptr Language foreign import ccall unsafe "tree_sitter_godot_resource" tree_sitter_godot_resource :: Ptr Language foreign import ccall unsafe "tree_sitter_gomod" tree_sitter_gomod :: Ptr Language foreign import ccall unsafe "tree_sitter_go" tree_sitter_go :: Ptr Language foreign import ccall unsafe "tree_sitter_gowork" tree_sitter_gowork :: Ptr Language foreign import ccall unsafe "tree_sitter_graphql" tree_sitter_graphql :: Ptr Language foreign import ccall unsafe "tree_sitter_haskell" tree_sitter_haskell :: Ptr Language foreign import ccall unsafe "tree_sitter_hcl" tree_sitter_hcl :: Ptr Language foreign import ccall unsafe "tree_sitter_heex" tree_sitter_heex :: Ptr Language foreign import ccall unsafe "tree_sitter_hjson" tree_sitter_hjson :: Ptr Language foreign import ccall unsafe "tree_sitter_html" tree_sitter_html :: Ptr Language foreign import ccall unsafe "tree_sitter_http" tree_sitter_http :: Ptr Language foreign import ccall unsafe "tree_sitter_janet_simple" tree_sitter_janet_simple :: Ptr Language foreign import ccall unsafe "tree_sitter_javascript" tree_sitter_javascript :: Ptr Language foreign import ccall unsafe "tree_sitter_java" tree_sitter_java :: Ptr Language foreign import ccall unsafe "tree_sitter_jsdoc" tree_sitter_jsdoc :: Ptr Language foreign import ccall unsafe "tree_sitter_json5" tree_sitter_json5 :: Ptr Language foreign import ccall unsafe "tree_sitter_jsonnet" tree_sitter_jsonnet :: Ptr Language foreign import ccall unsafe "tree_sitter_json" tree_sitter_json :: Ptr Language foreign import ccall unsafe "tree_sitter_julia" tree_sitter_julia :: Ptr Language foreign import ccall unsafe "tree_sitter_kotlin" tree_sitter_kotlin :: Ptr Language foreign import ccall unsafe "tree_sitter_latex" tree_sitter_latex :: Ptr Language foreign import ccall unsafe "tree_sitter_ledger" tree_sitter_ledger :: Ptr Language foreign import ccall unsafe "tree_sitter_llvm" tree_sitter_llvm :: Ptr Language foreign import ccall unsafe "tree_sitter_lua" tree_sitter_lua :: Ptr Language foreign import ccall unsafe "tree_sitter_make" tree_sitter_make :: Ptr Language foreign import ccall unsafe "tree_sitter_markdown_inline" tree_sitter_markdown_inline :: Ptr Language foreign import ccall unsafe "tree_sitter_markdown" tree_sitter_markdown :: Ptr Language foreign import ccall unsafe "tree_sitter_nickel" tree_sitter_nickel :: Ptr Language foreign import ccall unsafe "tree_sitter_nix" tree_sitter_nix :: Ptr Language foreign import ccall unsafe "tree_sitter_norg" tree_sitter_norg :: Ptr Language foreign import ccall unsafe "tree_sitter_nu" tree_sitter_nu :: Ptr Language foreign import ccall unsafe "tree_sitter_ocaml_interface" tree_sitter_ocaml_interface :: Ptr Language foreign import ccall unsafe "tree_sitter_ocaml" tree_sitter_ocaml :: Ptr Language foreign import ccall unsafe "tree_sitter_perl" tree_sitter_perl :: Ptr Language foreign import ccall unsafe "tree_sitter_pgn" tree_sitter_pgn :: Ptr Language foreign import ccall unsafe "tree_sitter_php" tree_sitter_php :: Ptr Language foreign import ccall unsafe "tree_sitter_pioasm" tree_sitter_pioasm :: Ptr Language foreign import ccall unsafe "tree_sitter_prisma" tree_sitter_prisma :: Ptr Language foreign import ccall unsafe "tree_sitter_pug" tree_sitter_pug :: Ptr Language foreign import ccall unsafe "tree_sitter_python" tree_sitter_python :: Ptr Language foreign import ccall unsafe "tree_sitter_dbscheme" tree_sitter_ql_dbscheme :: Ptr Language foreign import ccall unsafe "tree_sitter_ql" tree_sitter_ql :: Ptr Language foreign import ccall unsafe "tree_sitter_query" tree_sitter_query :: Ptr Language foreign import ccall unsafe "tree_sitter_regex" tree_sitter_regex :: Ptr Language foreign import ccall unsafe "tree_sitter_rego" tree_sitter_rego :: Ptr Language foreign import ccall unsafe "tree_sitter_rst" tree_sitter_rst :: Ptr Language foreign import ccall unsafe "tree_sitter_r" tree_sitter_r :: Ptr Language foreign import ccall unsafe "tree_sitter_ruby" tree_sitter_ruby :: Ptr Language foreign import ccall unsafe "tree_sitter_rust" tree_sitter_rust :: Ptr Language foreign import ccall unsafe "tree_sitter_scala" tree_sitter_scala :: Ptr Language foreign import ccall unsafe "tree_sitter_scheme" tree_sitter_scheme :: Ptr Language foreign import ccall unsafe "tree_sitter_scss" tree_sitter_scss :: Ptr Language foreign import ccall unsafe "tree_sitter_smithy" tree_sitter_smithy :: Ptr Language foreign import ccall unsafe "tree_sitter_solidity" tree_sitter_solidity :: Ptr Language foreign import ccall unsafe "tree_sitter_sparql" tree_sitter_sparql :: Ptr Language foreign import ccall unsafe "tree_sitter_sql" tree_sitter_sql :: Ptr Language foreign import ccall unsafe "tree_sitter_supercollider" tree_sitter_supercollider :: Ptr Language foreign import ccall unsafe "tree_sitter_surface" tree_sitter_surface :: Ptr Language foreign import ccall unsafe "tree_sitter_svelte" tree_sitter_svelte :: Ptr Language foreign import ccall unsafe "tree_sitter_tiger" tree_sitter_tiger :: Ptr Language foreign import ccall unsafe "tree_sitter_tlaplus" tree_sitter_tlaplus :: Ptr Language foreign import ccall unsafe "tree_sitter_toml" tree_sitter_toml :: Ptr Language foreign import ccall unsafe "tree_sitter_tsq" tree_sitter_tsq :: Ptr Language foreign import ccall unsafe "tree_sitter_tsx" tree_sitter_tsx :: Ptr Language foreign import ccall unsafe "tree_sitter_turtle" tree_sitter_turtle :: Ptr Language foreign import ccall unsafe "tree_sitter_typescript" tree_sitter_typescript :: Ptr Language foreign import ccall unsafe "tree_sitter_verilog" tree_sitter_verilog :: Ptr Language foreign import ccall unsafe "tree_sitter_vim" tree_sitter_vim :: Ptr Language foreign import ccall unsafe "tree_sitter_vue" tree_sitter_vue :: Ptr Language foreign import ccall unsafe "tree_sitter_yaml" tree_sitter_yaml :: Ptr Language foreign import ccall unsafe "tree_sitter_yang" tree_sitter_yang :: Ptr Language foreign import ccall unsafe "tree_sitter_zig" tree_sitter_zig :: Ptr Language