mirror of
https://github.com/kristoferssolo/tree-sitter-bruno.git
synced 2026-03-22 00:36:24 +00:00
chore: update packages
This commit is contained in:
33
bindings/python/tree_sitter_bruno/__init__.py
generated
33
bindings/python/tree_sitter_bruno/__init__.py
generated
@@ -6,7 +6,7 @@ from ._binding import language
|
||||
|
||||
|
||||
def _get_query(name, file):
|
||||
query = _files(f"{__package__}.queries") / "bruno" / file
|
||||
query = _files(f"{__package__}.queries") / file
|
||||
globals()[name] = query.read_text()
|
||||
return globals()[name]
|
||||
|
||||
@@ -14,14 +14,14 @@ def _get_query(name, file):
|
||||
def __getattr__(name):
|
||||
# NOTE: uncomment these to include any queries that this grammar contains:
|
||||
|
||||
if name == "HIGHLIGHTS_QUERY":
|
||||
return _get_query("HIGHLIGHTS_QUERY", "highlights.scm")
|
||||
if name == "INJECTIONS_QUERY":
|
||||
return _get_query("INJECTIONS_QUERY", "injections.scm")
|
||||
# if name == "HIGHLIGHTS_QUERY":
|
||||
# return _get_query("HIGHLIGHTS_QUERY", "highlights.scm")
|
||||
# if name == "INJECTIONS_QUERY":
|
||||
# return _get_query("INJECTIONS_QUERY", "injections.scm")
|
||||
# if name == "LOCALS_QUERY":
|
||||
# return _get_query("LOCALS_QUERY", "locals.scm")
|
||||
if name == "TAGS_QUERY":
|
||||
return _get_query("TAGS_QUERY", "tags.scm")
|
||||
# if name == "TAGS_QUERY":
|
||||
# return _get_query("TAGS_QUERY", "tags.scm")
|
||||
|
||||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||
|
||||
@@ -36,18 +36,7 @@ __all__ = [
|
||||
|
||||
|
||||
def __dir__():
|
||||
return sorted(
|
||||
__all__
|
||||
+ [
|
||||
"__all__",
|
||||
"__builtins__",
|
||||
"__cached__",
|
||||
"__doc__",
|
||||
"__file__",
|
||||
"__loader__",
|
||||
"__name__",
|
||||
"__package__",
|
||||
"__path__",
|
||||
"__spec__",
|
||||
]
|
||||
)
|
||||
return sorted(__all__ + [
|
||||
"__all__", "__builtins__", "__cached__", "__doc__", "__file__",
|
||||
"__loader__", "__name__", "__package__", "__path__", "__spec__",
|
||||
])
|
||||
|
||||
6
bindings/python/tree_sitter_bruno/__init__.pyi
generated
6
bindings/python/tree_sitter_bruno/__init__.pyi
generated
@@ -2,9 +2,9 @@ from typing import Final
|
||||
|
||||
# NOTE: uncomment these to include any queries that this grammar contains:
|
||||
|
||||
HIGHLIGHTS_QUERY: Final[str]
|
||||
INJECTIONS_QUERY: Final[str]
|
||||
# HIGHLIGHTS_QUERY: Final[str]
|
||||
# INJECTIONS_QUERY: Final[str]
|
||||
# LOCALS_QUERY: Final[str]
|
||||
TAGS_QUERY: Final[str]
|
||||
# TAGS_QUERY: Final[str]
|
||||
|
||||
def language() -> object: ...
|
||||
|
||||
14
bindings/python/tree_sitter_bruno/binding.c
generated
14
bindings/python/tree_sitter_bruno/binding.c
generated
@@ -8,6 +8,13 @@ static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSE
|
||||
return PyCapsule_New(tree_sitter_bruno(), "tree_sitter.Language", NULL);
|
||||
}
|
||||
|
||||
static struct PyModuleDef_Slot slots[] = {
|
||||
#ifdef Py_GIL_DISABLED
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
#endif
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
static PyMethodDef methods[] = {
|
||||
{"language", _binding_language, METH_NOARGS,
|
||||
"Get the tree-sitter language for this grammar."},
|
||||
@@ -18,10 +25,11 @@ static struct PyModuleDef module = {
|
||||
.m_base = PyModuleDef_HEAD_INIT,
|
||||
.m_name = "_binding",
|
||||
.m_doc = NULL,
|
||||
.m_size = -1,
|
||||
.m_methods = methods
|
||||
.m_size = 0,
|
||||
.m_methods = methods,
|
||||
.m_slots = slots,
|
||||
};
|
||||
|
||||
PyMODINIT_FUNC PyInit__binding(void) {
|
||||
return PyModule_Create(&module);
|
||||
return PyModuleDef_Init(&module);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user