mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
test(tiger): import upstream tests
This commit is contained in:
parent
ef385991b6
commit
6e3f888dc7
16 changed files with 454 additions and 0 deletions
14
tests/indent/tiger/classes.tig
Normal file
14
tests/indent/tiger/classes.tig
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class A {
|
||||
var a := 12
|
||||
|
||||
method method() : int = 1
|
||||
}
|
||||
|
||||
type B = class extends A {
|
||||
var b := 27
|
||||
|
||||
method another_method() = (
|
||||
print("called");
|
||||
self.b + self.method()
|
||||
)
|
||||
}
|
||||
22
tests/indent/tiger/control-flow.tig
Normal file
22
tests/indent/tiger/control-flow.tig
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(
|
||||
if
|
||||
12
|
||||
then
|
||||
27
|
||||
else
|
||||
42
|
||||
;
|
||||
|
||||
for
|
||||
i := 12
|
||||
to
|
||||
27
|
||||
do
|
||||
42
|
||||
;
|
||||
|
||||
while
|
||||
0
|
||||
do
|
||||
break
|
||||
)
|
||||
14
tests/indent/tiger/functions.tig
Normal file
14
tests/indent/tiger/functions.tig
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
primitive long_parameter_list(
|
||||
a: int,
|
||||
b: string,
|
||||
c: type
|
||||
)
|
||||
|
||||
function f() =
|
||||
(
|
||||
long_parameter_list(
|
||||
1,
|
||||
"2",
|
||||
nil
|
||||
)
|
||||
)
|
||||
10
tests/indent/tiger/groupings.tig
Normal file
10
tests/indent/tiger/groupings.tig
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
let
|
||||
var a := 42
|
||||
in
|
||||
(
|
||||
12;
|
||||
27;
|
||||
42
|
||||
);
|
||||
a
|
||||
end
|
||||
30
tests/indent/tiger/values-and-expressions.tig
Normal file
30
tests/indent/tiger/values-and-expressions.tig
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
let
|
||||
type array_of_int = array of int
|
||||
|
||||
type record = {
|
||||
a: int,
|
||||
b: string,
|
||||
c: type
|
||||
}
|
||||
|
||||
var a :=
|
||||
"a string"
|
||||
in
|
||||
array[
|
||||
12
|
||||
]
|
||||
;
|
||||
|
||||
array_of_int[
|
||||
27
|
||||
]
|
||||
of
|
||||
42
|
||||
;
|
||||
|
||||
record {
|
||||
a = 1,
|
||||
b = "2",
|
||||
c = nil
|
||||
}
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue