Rename to 'tree-sitter-bp'
All checks were successful
ci/woodpecker/push/check Pipeline was successful

This is really just to simplify my life and align with the Vim/NeoVim
filetype name.
This commit is contained in:
Bruno BELANYI 2024-04-10 15:30:57 +00:00
parent f6e1266493
commit ebb642cb14
12 changed files with 24 additions and 24 deletions

2
.gitignore vendored
View file

@ -3,6 +3,6 @@
/.pre-commit-config.yaml
# Tree-sitter artifact
/tree-sitter-blueprint.wasm
/tree-sitter-bp.wasm
# Rust bindings
/target

View file

@ -1,10 +1,10 @@
[package]
name = "tree-sitter-blueprint"
name = "tree-sitter-bp"
description = "Blueprint grammar for the tree-sitter parsing library"
version = "0.1.0"
keywords = ["incremental", "parsing", "android", "blueprint"]
categories = ["parsing", "text-editors"]
repository = "https://git.belanyi.fr/ambroisie/tree-sitter-blueprint"
repository = "https://git.belanyi.fr/ambroisie/tree-sitter-bp"
edition = "2018"
license = "MIT"

View file

@ -1,4 +1,4 @@
# tree-sitter-blueprint
# tree-sitter-bp
Tree-sitter grammar for [Blueprint][blueprint-aosp], the meta-build system used
in AOSP for its `Android.bp` files.

View file

@ -1,7 +1,7 @@
{
"targets": [
{
"target_name": "tree_sitter_blueprint_binding",
"target_name": "tree_sitter_bp_binding",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"src"

View file

@ -4,7 +4,7 @@
using namespace v8;
extern "C" TSLanguage * tree_sitter_blueprint();
extern "C" TSLanguage * tree_sitter_bp();
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_blueprint());
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_bp());
Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("blueprint").ToLocalChecked());
Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("bp").ToLocalChecked());
Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance);
}
NODE_MODULE(tree_sitter_blueprint_binding, Init)
NODE_MODULE(tree_sitter_bp_binding, Init)
} // namespace

View file

@ -1,11 +1,11 @@
try {
module.exports = require("../../build/Release/tree_sitter_blueprint_binding");
module.exports = require("../../build/Release/tree_sitter_bp_binding");
} catch (error1) {
if (error1.code !== 'MODULE_NOT_FOUND') {
throw error1;
}
try {
module.exports = require("../../build/Debug/tree_sitter_blueprint_binding");
module.exports = require("../../build/Debug/tree_sitter_bp_binding");
} catch (error2) {
if (error2.code !== 'MODULE_NOT_FOUND') {
throw error2;

View file

@ -1,4 +1,4 @@
//! This crate provides blueprint support for the [tree-sitter][] parsing library.
//! This crate provides bp 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_blueprint::language()).expect("Error loading txtpb grammar");
//! parser.set_language(tree_sitter_bp::language()).expect("Error loading txtpb grammar");
//! let tree = parser.parse(code, None).unwrap();
//! ```
//!
@ -18,14 +18,14 @@
use tree_sitter::Language;
extern "C" {
fn tree_sitter_blueprint() -> Language;
fn tree_sitter_bp() -> 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_blueprint() }
unsafe { tree_sitter_bp() }
}
/// 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 blueprint language");
.expect("Error loading bp language");
}
}

View file

@ -122,9 +122,9 @@
};
packages = {
default = packages.tree-sitter-blueprint;
default = packages.tree-sitter-bp;
inherit (pkgs.tree-sitter.passthru.builtGrammars) tree-sitter-blueprint;
inherit (pkgs.tree-sitter.passthru.builtGrammars) tree-sitter-bp;
inherit (pkgs) tree-sitter;
};
@ -133,7 +133,7 @@
default = final: prev: {
tree-sitter = prev.tree-sitter.override {
extraGrammars = {
tree-sitter-blueprint = {
tree-sitter-bp = {
src = ./.;
};
};

View file

@ -7,7 +7,7 @@ function trailingCommaSeparated(elem) {
}
module.exports = grammar({
name: "blueprint",
name: "bp",
extras: ($) => [
/\s+/,

View file

@ -1,5 +1,5 @@
{
"name": "tree-sitter-blueprint",
"name": "tree-sitter-bp",
"version": "0.1.0",
"description": "Blueprint grammar for tree-sitter",
"main": "bindings/node",
@ -18,7 +18,7 @@
},
"tree-sitter": [
{
"scope": "source.blueprint",
"scope": "source.bp",
"file-types": [
"bp"
],

2
src/grammar.json generated
View file

@ -1,5 +1,5 @@
{
"name": "blueprint",
"name": "bp",
"rules": {
"source_file": {
"type": "REPEAT",

2
src/parser.c generated
View file

@ -7926,7 +7926,7 @@ extern "C" {
#define extern __declspec(dllexport)
#endif
extern const TSLanguage *tree_sitter_blueprint(void) {
extern const TSLanguage *tree_sitter_bp(void) {
static const TSLanguage language = {
.version = LANGUAGE_VERSION,
.symbol_count = SYMBOL_COUNT,