aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query/highlights/gleam/function.gleam
blob: 89a302706e73bcfbb6dc46749004de2d7fa976eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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