mirror of
https://github.com/pnx/tree-sitter-dotenv
synced 2026-06-16 01:54:56 +02:00
update outdated files via tree-sitter init -u
This commit is contained in:
parent
940f387a98
commit
58608e4796
11 changed files with 137 additions and 27 deletions
6
bindings/node/index.js
generated
6
bindings/node/index.js
generated
|
|
@ -1,6 +1,10 @@
|
|||
const root = require("path").join(__dirname, "..", "..");
|
||||
|
||||
module.exports = require("node-gyp-build")(root);
|
||||
module.exports =
|
||||
typeof process.versions.bun === "string"
|
||||
// Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time
|
||||
? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-dotenv.node`)
|
||||
: require("node-gyp-build")(root);
|
||||
|
||||
try {
|
||||
module.exports.nodeTypeInfo = require("../../src/node-types.json");
|
||||
|
|
|
|||
2
bindings/python/tests/test_binding.py
generated
2
bindings/python/tests/test_binding.py
generated
|
|
@ -6,6 +6,6 @@ import tree_sitter, tree_sitter_dotenv
|
|||
class TestLanguage(TestCase):
|
||||
def test_can_load_grammar(self):
|
||||
try:
|
||||
tree_sitter.Language(tree_sitter_dotenv.language())
|
||||
Parser(Language(tree_sitter_dotenv.language()))
|
||||
except Exception:
|
||||
self.fail("Error loading Dotenv grammar")
|
||||
|
|
|
|||
14
bindings/python/tree_sitter_dotenv/binding.c
generated
14
bindings/python/tree_sitter_dotenv/binding.c
generated
|
|
@ -8,6 +8,13 @@ static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSE
|
|||
return PyCapsule_New(tree_sitter_dotenv(), "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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue