mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 09:20:04 -04:00
Gleam highlight tests
This commit is contained in:
parent
b62750e328
commit
00dce44780
8 changed files with 290 additions and 4 deletions
127
tests/query/highlights/gleam/function.gleam
Normal file
127
tests/query/highlights/gleam/function.gleam
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
pub fn add(x: Int, y: Int) -> Int {
|
||||
// <- keyword
|
||||
// ^ keyword.function
|
||||
// ^ function
|
||||
// ^ punctuation.bracket
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// ^ punctuation.delimiter
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
// <- punctuation.bracket
|
||||
|
||||
pub fn twice(f: fn(t) -> t, x: t) -> t {
|
||||
// <- keyword
|
||||
// ^ keyword.function
|
||||
// ^ function
|
||||
// ^ punctuation.bracket
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ keyword.function
|
||||
// ^ punctuation.bracket
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ type
|
||||
// ^ punctuation.delimiter
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
// <- punctuation.bracket
|
||||
|
||||
fn list_of_two(my_value: a) -> List(a) {
|
||||
// <- keyword.function
|
||||
// ^ function
|
||||
// ^ punctuation.bracket
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
// <- punctuation.bracket
|
||||
|
||||
fn replace(
|
||||
// <- keyword.function
|
||||
// ^ function
|
||||
// ^ punctuation.bracket
|
||||
in string: String,
|
||||
// <- symbol
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// ^ punctuation.delimiter
|
||||
each pattern: String,
|
||||
// <- symbol
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// ^ punctuation.delimiter
|
||||
with replacement: String,
|
||||
// <- symbol
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// ^ punctuation.delimiter
|
||||
) {
|
||||
replace(in: "A,B,C", each: ",", with: " ")
|
||||
// <- function
|
||||
// ^ punctuation.bracket
|
||||
// ^ symbol
|
||||
// ^ symbol
|
||||
// ^ string
|
||||
// ^ punctuation.delimiter
|
||||
// ^ symbol
|
||||
// ^ symbol
|
||||
// ^ string
|
||||
// ^ punctuation.delimiter
|
||||
// ^ symbol
|
||||
// ^ symbol
|
||||
// ^ string
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
// <- punctuation.bracket
|
||||
|
||||
pub external fn random_float() -> Float = "rand" "uniform"
|
||||
// <- keyword
|
||||
// ^ keyword
|
||||
// ^ keyword.function
|
||||
// ^ function
|
||||
// ^ punctuation.bracket
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ type
|
||||
// ^ operator
|
||||
// ^ namespace
|
||||
// ^ function
|
||||
|
||||
pub external fn inspect(a) -> a = "Elixir.IO" "inspect"
|
||||
// <- keyword
|
||||
// ^ keyword
|
||||
// ^ keyword.function
|
||||
// ^ function
|
||||
// ^ punctuation.bracket
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ type
|
||||
// ^ operator
|
||||
// ^ namespace
|
||||
// ^ function
|
||||
Loading…
Add table
Add a link
Reference in a new issue