Module parse

Source
Expand description

Utilities for reading and parsing files with the diffsitter parser

Structs§

GrammarConfig
Configuration options pertaining to loading grammars and parsing files.
SUPPORTED_LANGUAGES
All of the languages diffsitter was compiled with support for.

Enums§

LoadingError
Possible errors that can arise when loading grammars

Functions§

construct_ts_lang_from_shared_lib
Create a tree sitter Language from a shared library object.
generate_language
Generate a tree-sitter language from a language string.
lang_name_from_file_ext
Load a language name from a file extension.
language_from_extDeprecated
Create an instance of a language from a file extension
parse_file
Parse a file to an AST
resolve_language_str
Get the language string that corresponds to an extension.
tree_sitter_bash
tree_sitter_c
tree_sitter_c_sharp
tree_sitter_constructor_symbol_name
Generate the method name to load a parser given the name of the language.
tree_sitter_cpp
tree_sitter_css
tree_sitter_go
tree_sitter_hcl
tree_sitter_java
tree_sitter_json
tree_sitter_markdown
tree_sitter_ocaml
tree_sitter_php
tree_sitter_python
tree_sitter_ruby
tree_sitter_rust
tree_sitter_tsx
tree_sitter_typescript
ts_language_abi_checked
A convenience function to check of a tree-sitter language has a compatible ABI version for diffsitter.