mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
feat(nu): add parser and queries (#7267)
This commit is contained in:
parent
509d38fee8
commit
604aa5a7c8
12 changed files with 449 additions and 0 deletions
6
tests/indent/nu/closure.nu
Normal file
6
tests/indent/nu/closure.nu
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
do { |x, y|
|
||||
print ($x + $y);
|
||||
print ($x - $y);
|
||||
print ($x * $y);
|
||||
print ($x / $y);
|
||||
}
|
||||
3
tests/indent/nu/for.nu
Normal file
3
tests/indent/nu/for.nu
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for x in 1..3 {
|
||||
print ($x * $x)
|
||||
}
|
||||
5
tests/indent/nu/if_else.nu
Normal file
5
tests/indent/nu/if_else.nu
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
if true {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
7
tests/indent/nu/list.nu
Normal file
7
tests/indent/nu/list.nu
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
let my_list = [
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
qux
|
||||
quux
|
||||
]
|
||||
4
tests/indent/nu/record.nu
Normal file
4
tests/indent/nu/record.nu
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
let my_record = {
|
||||
foo: "bar"
|
||||
bar: 1
|
||||
}
|
||||
9
tests/indent/nu/table.nu
Normal file
9
tests/indent/nu/table.nu
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
let my_table = [
|
||||
[a b];
|
||||
[1 2]
|
||||
[3 4]
|
||||
[5 6]
|
||||
[7 8]
|
||||
[9 10]
|
||||
[11 12]
|
||||
]
|
||||
17
tests/indent/nu_spec.lua
Normal file
17
tests/indent/nu_spec.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
local Runner = require("tests.indent.common").Runner
|
||||
--local XFAIL = require("tests.indent.common").XFAIL
|
||||
|
||||
local run = Runner:new(it, "tests/indent/nu", {
|
||||
tabstop = 2,
|
||||
shiftwidth = 2,
|
||||
softtabstop = -1,
|
||||
expandtab = true,
|
||||
})
|
||||
|
||||
describe("indent Nu:", function()
|
||||
describe("whole file:", function()
|
||||
run:whole_file(".", {
|
||||
expected_failures = {},
|
||||
})
|
||||
end)
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue