diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-10-04 14:29:04 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-10-04 14:29:04 +0200 |
| commit | 0e6205ebcb990fd57f5056c1cf5e9de1487be934 (patch) | |
| tree | c3c96a45874df6326965e3aada63c9e9184aeb8d /bindings | |
| parent | 4a1d56285559545a56cb7c79a0ea1564f01e09e5 (diff) | |
Update name
Diffstat (limited to 'bindings')
| -rw-r--r-- | bindings/node/binding.cc | 8 | ||||
| -rw-r--r-- | bindings/node/index.js | 4 | ||||
| -rw-r--r-- | bindings/rust/lib.rs | 10 |
3 files changed, 11 insertions, 11 deletions
diff --git a/bindings/node/binding.cc b/bindings/node/binding.cc index 54f34ac..ffae1ee 100644 --- a/bindings/node/binding.cc +++ b/bindings/node/binding.cc @@ -4,7 +4,7 @@ using namespace v8; -extern "C" TSLanguage * tree_sitter_apinotation(); +extern "C" TSLanguage * tree_sitter_api_notation(); namespace { @@ -17,12 +17,12 @@ void Init(Local<Object> exports, Local<Object> module) { Local<Function> constructor = Nan::GetFunction(tpl).ToLocalChecked(); Local<Object> instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked(); - Nan::SetInternalFieldPointer(instance, 0, tree_sitter_apinotation()); + Nan::SetInternalFieldPointer(instance, 0, tree_sitter_api_notation()); - Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("apinotation").ToLocalChecked()); + Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("api_notation").ToLocalChecked()); Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance); } -NODE_MODULE(tree_sitter_apinotation_binding, Init) +NODE_MODULE(tree_sitter_api_notation_binding, Init) } // namespace diff --git a/bindings/node/index.js b/bindings/node/index.js index d7f66fd..cf8c768 100644 --- a/bindings/node/index.js +++ b/bindings/node/index.js @@ -1,11 +1,11 @@ try { - module.exports = require("../../build/Release/tree_sitter_apinotation_binding"); + module.exports = require("../../build/Release/tree_sitter_api_notation_binding"); } catch (error1) { if (error1.code !== 'MODULE_NOT_FOUND') { throw error1; } try { - module.exports = require("../../build/Debug/tree_sitter_apinotation_binding"); + module.exports = require("../../build/Debug/tree_sitter_api_notation_binding"); } catch (error2) { if (error2.code !== 'MODULE_NOT_FOUND') { throw error2; diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs index ee3d344..7bc923a 100644 --- a/bindings/rust/lib.rs +++ b/bindings/rust/lib.rs @@ -1,4 +1,4 @@ -//! This crate provides apinotation language support for the [tree-sitter][] parsing library. +//! This crate provides api-notation language support for the [tree-sitter][] parsing library. //! //! Typically, you will use the [language][language func] function to add this language to a //! tree-sitter [Parser][], and then use the parser to parse some code: @@ -6,7 +6,7 @@ //! ``` //! let code = ""; //! let mut parser = tree_sitter::Parser::new(); -//! parser.set_language(tree_sitter_apinotation::language()).expect("Error loading apinotation grammar"); +//! parser.set_language(tree_sitter_api_notation::language()).expect("Error loading api-notation grammar"); //! let tree = parser.parse(code, None).unwrap(); //! ``` //! @@ -18,14 +18,14 @@ use tree_sitter::Language; extern "C" { - fn tree_sitter_apinotation() -> Language; + fn tree_sitter_api_notation() -> Language; } /// Get the tree-sitter [Language][] for this grammar. /// /// [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html pub fn language() -> Language { - unsafe { tree_sitter_apinotation() } + unsafe { tree_sitter_api_notation() } } /// The content of the [`node-types.json`][] file for this grammar. @@ -47,6 +47,6 @@ mod tests { let mut parser = tree_sitter::Parser::new(); parser .set_language(super::language()) - .expect("Error loading apinotation language"); + .expect("Error loading api-notation language"); } } |