mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(gleam): update tests reflecting recent changes
This commit is contained in:
parent
c8c083e8ce
commit
4a4c475617
6 changed files with 103 additions and 102 deletions
|
|
@ -1,13 +1,13 @@
|
|||
pub fn main() {
|
||||
assert Ok(i) = parse_int("123")
|
||||
// <- exception
|
||||
// ^ type
|
||||
// ^^ constructor
|
||||
// ^ punctuation.bracket
|
||||
// ^ variable
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ function
|
||||
// ^^^^^^^^^ function.call
|
||||
// ^ punctuation.bracket
|
||||
// ^ string
|
||||
// ^^^^^ string
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
pub fn add(x: Int, y: Int) -> Int {
|
||||
// <- type.qualifier
|
||||
// ^ keyword.function
|
||||
// ^ function
|
||||
// ^^ keyword.function
|
||||
// ^^^ function
|
||||
// ^ punctuation.bracket
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^ type.builtin
|
||||
// ^ punctuation.delimiter
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^ type.builtin
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ type
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^ type.builtin
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
// <- punctuation.bracket
|
||||
|
|
@ -20,22 +20,22 @@ pub fn add(x: Int, y: Int) -> Int {
|
|||
pub fn twice(f: fn(t) -> t, x: t) -> t {
|
||||
// <- type.qualifier
|
||||
// ^ keyword.function
|
||||
// ^ function
|
||||
// ^^^^^ function
|
||||
// ^ punctuation.bracket
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ keyword.function
|
||||
// ^ punctuation.delimiter
|
||||
// ^^ keyword.function
|
||||
// ^ punctuation.bracket
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^^ punctuation.delimiter
|
||||
// ^ type
|
||||
// ^ punctuation.delimiter
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ punctuation.delimiter
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^^ punctuation.delimiter
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
|
|
@ -46,11 +46,11 @@ fn list_of_two(my_value: a) -> List(a) {
|
|||
// ^ function
|
||||
// ^ punctuation.bracket
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ punctuation.delimiter
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ type
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^ type.builtin
|
||||
// ^ punctuation.bracket
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
|
|
@ -60,68 +60,68 @@ fn list_of_two(my_value: a) -> List(a) {
|
|||
|
||||
fn replace(
|
||||
// <- keyword.function
|
||||
// ^ function
|
||||
// ^^^^^^^ function
|
||||
// ^ punctuation.bracket
|
||||
in string: String,
|
||||
// <- symbol
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// <- label
|
||||
// ^^^^^^ parameter
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^^^ type.builtin
|
||||
// ^ punctuation.delimiter
|
||||
each pattern: String,
|
||||
// <- symbol
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// <- label
|
||||
// ^^^^^^^ parameter
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^^^ type.builtin
|
||||
// ^ punctuation.delimiter
|
||||
with replacement: String,
|
||||
// <- symbol
|
||||
// ^ parameter
|
||||
// ^ parameter
|
||||
// ^ type
|
||||
// <- label
|
||||
// ^^^^^^^^^^^ parameter
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^^^ type.builtin
|
||||
// ^ punctuation.delimiter
|
||||
) {
|
||||
replace(in: "A,B,C", each: ",", with: " ")
|
||||
// <- function
|
||||
// <- function.call
|
||||
// ^ punctuation.bracket
|
||||
// ^ symbol
|
||||
// ^ symbol
|
||||
// ^ string
|
||||
// ^^ label
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^^^^ string
|
||||
// ^ punctuation.delimiter
|
||||
// ^ symbol
|
||||
// ^ symbol
|
||||
// ^ string
|
||||
// ^^^^ label
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^ string
|
||||
// ^ punctuation.delimiter
|
||||
// ^ symbol
|
||||
// ^ symbol
|
||||
// ^ string
|
||||
// ^^^^ label
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^ string
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
// <- punctuation.bracket
|
||||
|
||||
pub external fn random_float() -> Float = "rand" "uniform"
|
||||
// <- type.qualifier
|
||||
// ^ type.qualifier
|
||||
// ^ keyword.function
|
||||
// ^ function
|
||||
// ^^^^^^^^ type.qualifier
|
||||
// ^^ keyword.function
|
||||
// ^^^^^^^^^^^^ function
|
||||
// ^ punctuation.bracket
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ type
|
||||
// ^^ punctuation.delimiter
|
||||
// ^^^^^ type.builtin
|
||||
// ^ operator
|
||||
// ^ namespace
|
||||
// ^ function
|
||||
// ^^^^^^ namespace
|
||||
// ^^^^^^^^^ function
|
||||
|
||||
pub external fn inspect(a) -> a = "Elixir.IO" "inspect"
|
||||
// <- type.qualifier
|
||||
// ^ type.qualifier
|
||||
// ^ keyword.function
|
||||
// ^ function
|
||||
// ^^^^^^^^ type.qualifier
|
||||
// ^^ keyword.function
|
||||
// ^^^^^^^ function
|
||||
// ^ punctuation.bracket
|
||||
// ^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^^ punctuation.delimiter
|
||||
// ^ type
|
||||
// ^ operator
|
||||
// ^ namespace
|
||||
// ^ function
|
||||
// ^^^^^^^^^^^ namespace
|
||||
// ^^^^^^^^^ function
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import gleam/io
|
||||
// <- include
|
||||
// ^ namespace
|
||||
// ^ namespace
|
||||
// ^ operator
|
||||
// ^ namespace
|
||||
|
||||
import cat as kitten
|
||||
|
|
@ -13,10 +13,10 @@ import cat as kitten
|
|||
import animal/cat.{Cat, stroke}
|
||||
// <- include
|
||||
// ^ namespace
|
||||
// ^ namespace
|
||||
// ^ operator
|
||||
// ^ punctuation.delimiter
|
||||
// ^ punctuation.bracket
|
||||
// ^ type
|
||||
// ^^^ type
|
||||
// ^ punctuation.delimiter
|
||||
// ^ function
|
||||
// ^^^^^^ function
|
||||
// ^ punctuation.bracket
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ pub fn run() {
|
|||
// <- number
|
||||
|> add(_, 2)
|
||||
// <- operator
|
||||
// ^ function
|
||||
// ^^^ function.call
|
||||
// ^ punctuation.bracket
|
||||
// ^ comment
|
||||
// ^ punctuation.delimiter
|
||||
|
|
@ -11,7 +11,7 @@ pub fn run() {
|
|||
// ^ punctuation.bracket
|
||||
|> add(3)
|
||||
// <- operator
|
||||
// ^ function
|
||||
// ^^^ function.call
|
||||
// ^ punctuation.bracket
|
||||
// ^ number
|
||||
// ^ punctuation.bracket
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
pub fn main() {
|
||||
try x = Ok(1)
|
||||
// <- keyword
|
||||
// <- exception
|
||||
// ^ variable
|
||||
// ^ operator
|
||||
// ^ type
|
||||
// ^^ constant.builtin
|
||||
// ^ punctuation.bracket
|
||||
// ^ number
|
||||
// ^ punctuation.bracket
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
pub type Cat {
|
||||
// <- type.qualifier
|
||||
// ^ keyword.function
|
||||
// ^ type
|
||||
// ^^^^ keyword
|
||||
// ^^^ type
|
||||
// ^ punctuation.bracket
|
||||
Cat(name: String, cuteness: Int)
|
||||
// <- type
|
||||
// <- constructor
|
||||
// ^ punctuation.bracket
|
||||
// ^ property
|
||||
// ^ property
|
||||
// ^ type
|
||||
// ^^^^ property
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^^^ type.builtin
|
||||
// ^ punctuation.delimiter
|
||||
// ^ property
|
||||
// ^ property
|
||||
// ^ type
|
||||
// ^^^^^^^^ property
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^ type.builtin
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
|
||||
|
|
@ -20,64 +20,65 @@ fn cats() {
|
|||
Cat(name: "Nubi", cuteness: 2001)
|
||||
// <- type
|
||||
// ^ punctuation.bracket
|
||||
// ^ property
|
||||
// ^ property
|
||||
// ^ string
|
||||
// ^^^^ property
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^^^ string
|
||||
// ^ punctuation.delimiter
|
||||
// ^ property
|
||||
// ^ property
|
||||
// ^ number
|
||||
// ^^^^^^^^ property
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^ number
|
||||
// ^ punctuation.bracket
|
||||
Cat("Ginny", 1950)
|
||||
// <- type
|
||||
// <- constructor
|
||||
// ^ punctuation.bracket
|
||||
// ^ string
|
||||
// ^^^^^^^ string
|
||||
// ^ punctuation.delimiter
|
||||
// ^ number
|
||||
// ^^^^ number
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
|
||||
type Box(inner_type) {
|
||||
// <- keyword.function
|
||||
// ^ type
|
||||
// <- keyword
|
||||
// ^^^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ parameter
|
||||
// ^^^^^^^^^^ type
|
||||
// ^ punctuation.bracket
|
||||
// ^ punctuation.bracket
|
||||
Box(inner: inner_type)
|
||||
// <- type
|
||||
// <- constructor
|
||||
// ^ punctuation.bracket
|
||||
// ^ property
|
||||
// ^ property
|
||||
// ^ type
|
||||
// ^^^^^ property
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^^^^^^^ type
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
|
||||
pub opaque type Counter {
|
||||
// <- type.qualifier
|
||||
// ^ type.qualifier
|
||||
// ^ keyword.function
|
||||
// ^ type
|
||||
// ^^^^^^ type.qualifier
|
||||
// ^^^^ keyword
|
||||
// ^^^^^^^ type
|
||||
// ^ punctuation.bracket
|
||||
Counter(value: Int)
|
||||
}
|
||||
|
||||
pub fn have_birthday(person) {
|
||||
Person(..person, age: person.age + 1, is_happy: True)
|
||||
// <- type
|
||||
// <- constructor
|
||||
// ^ punctuation.bracket
|
||||
// ^ operator
|
||||
// ^ variable
|
||||
// ^^ operator
|
||||
// ^^^^^^ variable
|
||||
// ^ punctuation.delimiter
|
||||
// ^ property
|
||||
// ^ property
|
||||
// ^ variable
|
||||
// ^^^ property
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^^^ variable
|
||||
// ^ punctuation.delimiter
|
||||
// ^ property
|
||||
// ^^^ property
|
||||
// ^ operator
|
||||
// ^ number
|
||||
// ^ punctuation.delimiter
|
||||
// ^ property
|
||||
// ^ property
|
||||
// ^ boolean
|
||||
// ^^^^^^^^ property
|
||||
// ^ punctuation.delimiter
|
||||
// ^^^^ boolean
|
||||
// ^ punctuation.bracket
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue