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