Compare commits
18 commits
6b2ecc78ac
...
2326d709fb
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 2326d709fb | ||
Bruno BELANYI | bf783d99bc | ||
Bruno BELANYI | c5031e2c16 | ||
Bruno BELANYI | f228904ed0 | ||
Bruno BELANYI | 5cbdf5e3ac | ||
Bruno BELANYI | 533c82cdf3 | ||
Bruno BELANYI | d25b07cae0 | ||
Bruno BELANYI | ff40b39dcf | ||
Bruno BELANYI | d01bcf0f6d | ||
Bruno BELANYI | 0816633d9a | ||
Bruno BELANYI | 6ca4592d84 | ||
Bruno BELANYI | afdfbff7bc | ||
Bruno BELANYI | f6bc0f887a | ||
Bruno BELANYI | 2649422636 | ||
Bruno BELANYI | 1c1387fee0 | ||
Bruno BELANYI | 8137fd3e5b | ||
Bruno BELANYI | 9e46303a1d | ||
Bruno BELANYI | 1af33aeea1 |
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "tree-sitter-bp"
|
||||
description = "Blueprint grammar for the tree-sitter parsing library"
|
||||
version = "0.3.0"
|
||||
version = "0.4.0"
|
||||
keywords = ["incremental", "parsing", "android", "blueprint"]
|
||||
categories = ["parsing", "text-editors"]
|
||||
repository = "https://git.belanyi.fr/ambroisie/tree-sitter-bp"
|
||||
|
|
|
@ -61,6 +61,10 @@
|
|||
export NVIM_TREESITTER_TEXTOBJECTS='${pkgs.vimPlugins.nvim-treesitter-textobjects}'
|
||||
export NVIM_TREESITTER_PARSER='${pkgs.vimPlugins.nvim-treesitter.grammarToPlugin self.packages.${system}.tree-sitter-bp}'
|
||||
|
||||
# FIXME: not sure why, but I get different behaviour when left untouched
|
||||
XDG_CONFIG_HOME=$(mktemp -d)
|
||||
export XDG_CONFIG_HOME
|
||||
|
||||
nvim --headless --noplugin -u ${scripts/minimal_init.lua} \
|
||||
-c "PlenaryBustedDirectory test/ { minimal_init = '${./scripts/minimal_init.lua}' }"
|
||||
'';
|
||||
|
@ -74,8 +78,9 @@
|
|||
${pkgs.jq}/bin/jq ".version = \"''${NEW_VERSION}\"" package.json > package.json.tmp
|
||||
mv package.json.tmp package.json
|
||||
${pkgs.gnused}/bin/sed -i -e "s/version = \"[0-9.]\\+\"/version = \"''${NEW_VERSION}\"/" Cargo.toml
|
||||
${pkgs.gnused}/bin/sed -i -e "s/version = \"[0-9.]\\+\"/version = \"''${NEW_VERSION}\"/" pyproject.toml
|
||||
|
||||
git add Cargo.toml package.json
|
||||
git add Cargo.toml package.json pyproject.toml
|
||||
echo "Release ''${NEW_VERSION}" | git commit -eF -
|
||||
git tag -a "v''${NEW_VERSION}" -m "Release ''${NEW_VERSION}"
|
||||
'';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "tree-sitter-bp",
|
||||
"version": "0.3.0",
|
||||
"version": "0.4.0",
|
||||
"description": "Blueprint grammar for tree-sitter",
|
||||
"main": "bindings/node",
|
||||
"types": "bindings/node",
|
||||
|
|
|
@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|||
[project]
|
||||
name = "tree-sitter-bp"
|
||||
description = "Bp grammar for tree-sitter"
|
||||
version = "0.0.1"
|
||||
version = "0.4.0"
|
||||
keywords = ["incremental", "parsing", "tree-sitter", "bp"]
|
||||
classifiers = [
|
||||
"Intended Audience :: Developers",
|
||||
|
|
|
@ -11,6 +11,15 @@
|
|||
(select_expression
|
||||
")" @indent.branch)
|
||||
|
||||
(select_value) @indent.begin
|
||||
(select_value
|
||||
")" @indent.branch)
|
||||
|
||||
(select_pattern
|
||||
"(" @indent.begin)
|
||||
(select_pattern
|
||||
")" @indent.branch)
|
||||
|
||||
(select_cases) @indent.begin
|
||||
(select_cases
|
||||
"}" @indent.branch)
|
||||
|
|
|
@ -26,3 +26,35 @@ foo = select(
|
|||
default: 0,
|
||||
}
|
||||
)
|
||||
|
||||
foo = select((
|
||||
arch(),
|
||||
os(),
|
||||
), {
|
||||
(default, default): [],
|
||||
})
|
||||
|
||||
foo = select(
|
||||
(arch(), os()),
|
||||
{
|
||||
(default, default): [],
|
||||
}
|
||||
)
|
||||
|
||||
// We're really getting into more and more unlikely choices here...
|
||||
foo = select(
|
||||
(
|
||||
arch(),
|
||||
os(),
|
||||
),
|
||||
{
|
||||
(default, default): [],
|
||||
}
|
||||
)
|
||||
|
||||
foo = select((arch(), os()), {
|
||||
(
|
||||
default,
|
||||
default,
|
||||
): [],
|
||||
})
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package.path = package.path .. ";" .. vim.env.NVIM_TREESITTER .. "/?.lua"
|
||||
|
||||
local Runner = require("tests.indent.common").Runner
|
||||
local XFAIL = require("tests.indent.common").XFAIL
|
||||
|
||||
-- FIXME: path to root
|
||||
local runner = Runner:new(it, ".", {
|
||||
|
@ -19,7 +20,7 @@ describe("indent Blueprint:", function()
|
|||
})
|
||||
runner:whole_file("test/indent/", {
|
||||
expected_failures = {
|
||||
-- NOTE: none for now
|
||||
"test/indent/select.bp",
|
||||
},
|
||||
})
|
||||
end)
|
||||
|
@ -47,5 +48,14 @@ describe("indent Blueprint:", function()
|
|||
runner:new_line("test/indent/select.bp", { on_line = 26, text = 'default: "value"', indent = 8 }, "default case, trailing, alternate formatting")
|
||||
runner:new_line("test/indent/select.bp", { on_line = 26, text = '}', indent = 4 }, "select cases closing delimiter, alternate formatting")
|
||||
runner:new_line("test/indent/select.bp", { on_line = 27, text = ')', indent = 0 }, "select expression closing delimiter, alternate formatting")
|
||||
runner:new_line("test/indent/select.bp", { on_line = 30, text = 'device()', indent = 4 }, "multi-valued select condition, begin")
|
||||
runner:new_line("test/indent/select.bp", { on_line = 31, text = 'device()', indent = 4 }, "multi-valued select condition, middle")
|
||||
runner:new_line("test/indent/select.bp", { on_line = 32, text = 'device()', indent = 4 }, "multi-valued select condition, end")
|
||||
runner:new_line("test/indent/select.bp", { on_line = 46, text = 'device()', indent = 8 }, "multi-valued select condition, begin, alternate formatting")
|
||||
runner:new_line("test/indent/select.bp", { on_line = 47, text = 'device()', indent = 8 }, "multi-valued select condition, middle, alternate formatting")
|
||||
runner:new_line("test/indent/select.bp", { on_line = 48, text = 'device()', indent = 8 }, "multi-valued select condition, end, alternate formatting")
|
||||
runner:new_line("test/indent/select.bp", { on_line = 56, text = 'default,', indent = 8 }, "multi-valued select case, begin", XFAIL)
|
||||
runner:new_line("test/indent/select.bp", { on_line = 57, text = 'default,', indent = 8 }, "multi-valued select case, middle", XFAIL)
|
||||
runner:new_line("test/indent/select.bp", { on_line = 58, text = 'default,', indent = 8 }, "multi-valued select case, end", XFAIL)
|
||||
end)
|
||||
end)
|
||||
|
|
Loading…
Reference in a new issue