feat: support for fish

This commit is contained in:
Nils 2023-04-23 20:18:05 +02:00 committed by Lewis Russell
parent 27a725e034
commit 2d1dadab5c
2 changed files with 83 additions and 0 deletions

10
queries/fish/context.scm Normal file
View file

@ -0,0 +1,10 @@
([
(function_definition)
(while_statement)
(for_statement)
(switch_statement)
(case_clause)
(if_statement)
(else_if_clause)
(else_clause)
]) @context

73
test/test.fish Normal file
View file

@ -0,0 +1,73 @@
#!/usr/bin/env fish
function foo
while true
echo 'foo'
end
switch (uname)
case 'Linux'
echo 'Linux'
case 'Darwin'
echo 'Mac'
otherwise
echo 'Windows'
end
if grep fish /etc/shells
echo Found fish
else if grep bash /etc/shells
echo Found bash
else
echo Got nothing
end
for file in *.txt
cp $file $file.bak
end
end