feat(nu): add parser and queries (#7267)

This commit is contained in:
Abhishek Singh 2024-11-05 19:55:42 +05:30 committed by GitHub
parent 509d38fee8
commit 604aa5a7c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 449 additions and 0 deletions

View 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
View file

@ -0,0 +1,3 @@
for x in 1..3 {
print ($x * $x)
}

View file

@ -0,0 +1,5 @@
if true {
true
} else {
false
}

7
tests/indent/nu/list.nu Normal file
View file

@ -0,0 +1,7 @@
let my_list = [
foo
bar
baz
qux
quux
]

View file

@ -0,0 +1,4 @@
let my_record = {
foo: "bar"
bar: 1
}

9
tests/indent/nu/table.nu Normal file
View 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
View 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)