mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 19:30:02 -04:00
Gleam indentation tests
This commit is contained in:
parent
4a5720332d
commit
b62750e328
16 changed files with 239 additions and 0 deletions
4
tests/indent/gleam/assert.gleam
Normal file
4
tests/indent/gleam/assert.gleam
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
pub fn main() {
|
||||
assert Ok(i) =
|
||||
parse_int("123")
|
||||
}
|
||||
4
tests/indent/gleam/binary_expression.gleam
Normal file
4
tests/indent/gleam/binary_expression.gleam
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
pub fn main() {
|
||||
True &&
|
||||
False
|
||||
}
|
||||
10
tests/indent/gleam/case.gleam
Normal file
10
tests/indent/gleam/case.gleam
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
pub fn main() {
|
||||
case 1 {
|
||||
1 -> "One"
|
||||
2 -> {
|
||||
case 2 {
|
||||
2 -> "Two"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
tests/indent/gleam/constant.gleam
Normal file
2
tests/indent/gleam/constant.gleam
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
pub const foo =
|
||||
"bar"
|
||||
15
tests/indent/gleam/function.gleam
Normal file
15
tests/indent/gleam/function.gleam
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import gleam/io
|
||||
|
||||
pub fn main() {
|
||||
io.println("Hello from main!")
|
||||
}
|
||||
|
||||
fn hidden() {
|
||||
io.println("Hello from hidden!")
|
||||
}
|
||||
|
||||
pub external fn inspect(a) -> a =
|
||||
"Elixir.IO" "inspect"
|
||||
|
||||
external fn inspect(a) -> a =
|
||||
"Elixir.IO" "inspect"
|
||||
4
tests/indent/gleam/import.gleam
Normal file
4
tests/indent/gleam/import.gleam
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import foo.{
|
||||
Bar,
|
||||
baz,
|
||||
}
|
||||
4
tests/indent/gleam/let.gleam
Normal file
4
tests/indent/gleam/let.gleam
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
pub fn main() {
|
||||
let string =
|
||||
"string"
|
||||
}
|
||||
11
tests/indent/gleam/list.gleam
Normal file
11
tests/indent/gleam/list.gleam
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
pub fn main() {
|
||||
[
|
||||
a,
|
||||
..[
|
||||
b,
|
||||
..[
|
||||
c,
|
||||
]
|
||||
]
|
||||
]
|
||||
}
|
||||
4
tests/indent/gleam/pipe.gleam
Normal file
4
tests/indent/gleam/pipe.gleam
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
pub fn main() {
|
||||
one()
|
||||
|> two()
|
||||
}
|
||||
5
tests/indent/gleam/todo.gleam
Normal file
5
tests/indent/gleam/todo.gleam
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
pub fn main() {
|
||||
todo(
|
||||
"Foo"
|
||||
)
|
||||
}
|
||||
7
tests/indent/gleam/try.gleam
Normal file
7
tests/indent/gleam/try.gleam
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
pub fn main() {
|
||||
try int_a =
|
||||
parse_int(a)
|
||||
try int_b =
|
||||
parse_int(b)
|
||||
Ok(int_a + int_b)
|
||||
}
|
||||
11
tests/indent/gleam/tuple.gleam
Normal file
11
tests/indent/gleam/tuple.gleam
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
pub fn main() {
|
||||
#(
|
||||
a,
|
||||
#(
|
||||
b,
|
||||
#(
|
||||
c
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
18
tests/indent/gleam/type.gleam
Normal file
18
tests/indent/gleam/type.gleam
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
pub type Cat {
|
||||
Cat(name: String, cuteness: Int)
|
||||
}
|
||||
|
||||
type User {
|
||||
LoggedIn(name: String)
|
||||
Guest
|
||||
}
|
||||
|
||||
pub opaque type Counter {
|
||||
Counter(value: Int)
|
||||
}
|
||||
|
||||
pub type Headers =
|
||||
List(#(String, String))
|
||||
|
||||
type Headers =
|
||||
List(#(String, String))
|
||||
Loading…
Add table
Add a link
Reference in a new issue