| 1 |
---input--- |
| 2 |
x: x + 1 |
| 3 |
|
| 4 |
|
| 5 |
A function that expects an integer and returns it increased by 1 |
| 6 |
|
| 7 |
x: y: x + y |
| 8 |
|
| 9 |
(x: x + 1) 100 |
| 10 |
|
| 11 |
let inc = x: x + 1; in inc (inc (inc 100)) |
| 12 |
|
| 13 |
{ x, y }: x + y |
| 14 |
|
| 15 |
{ x, y ? "bar" }: x + y |
| 16 |
|
| 17 |
{ x, y, ... }: x + y |
| 18 |
|
| 19 |
{ x, y } @ args: x + y |
| 20 |
|
| 21 |
args @ { x, y }: x + y |
| 22 |
|
| 23 |
---tokens--- |
| 24 |
'x' Text |
| 25 |
':' Punctuation |
| 26 |
' ' Text |
| 27 |
'x' Text |
| 28 |
' ' Text |
| 29 |
'+' Operator |
| 30 |
' ' Text |
| 31 |
'1' Literal.Number.Integer |
| 32 |
'\n\n\n' Text |
| 33 |
|
| 34 |
'A' Text |
| 35 |
' ' Text |
| 36 |
'function' Text |
| 37 |
' ' Text |
| 38 |
'that' Text |
| 39 |
' ' Text |
| 40 |
'expects' Text |
| 41 |
' ' Text |
| 42 |
'an' Text |
| 43 |
' ' Text |
| 44 |
'integer' Text |
| 45 |
' ' Text |
| 46 |
'and' Operator.Word |
| 47 |
' ' Text |
| 48 |
'returns' Text |
| 49 |
' ' Text |
| 50 |
'it' Text |
| 51 |
' ' Text |
| 52 |
'increased' Text |
| 53 |
' ' Text |
| 54 |
'by' Text |
| 55 |
' ' Text |
| 56 |
'1' Literal.Number.Integer |
| 57 |
'\n\n' Text |
| 58 |
|
| 59 |
'x' Text |
| 60 |
':' Punctuation |
| 61 |
' ' Text |
| 62 |
'y' Text |
| 63 |
':' Punctuation |
| 64 |
' ' Text |
| 65 |
'x' Text |
| 66 |
' ' Text |
| 67 |
'+' Operator |
| 68 |
' ' Text |
| 69 |
'y' Text |
| 70 |
'\n\n' Text |
| 71 |
|
| 72 |
'(' Punctuation |
| 73 |
'x' Text |
| 74 |
':' Punctuation |
| 75 |
' ' Text |
| 76 |
'x' Text |
| 77 |
' ' Text |
| 78 |
'+' Operator |
| 79 |
' ' Text |
| 80 |
'1' Literal.Number.Integer |
| 81 |
')' Punctuation |
| 82 |
' ' Text |
| 83 |
'100' Literal.Number.Integer |
| 84 |
'\n\n' Text |
| 85 |
|
| 86 |
'let' Keyword |
| 87 |
' ' Text |
| 88 |
'inc' Literal.String.Symbol |
| 89 |
' ' Text |
| 90 |
'=' Operator |
| 91 |
' ' Text |
| 92 |
'x' Text |
| 93 |
':' Punctuation |
| 94 |
' ' Text |
| 95 |
'x' Text |
| 96 |
' ' Text |
| 97 |
'+' Operator |
| 98 |
' ' Text |
| 99 |
'1' Literal.Number.Integer |
| 100 |
';' Punctuation |
| 101 |
' ' Text |
| 102 |
'in' Keyword |
| 103 |
' ' Text |
| 104 |
'inc' Text |
| 105 |
' ' Text |
| 106 |
'(' Punctuation |
| 107 |
'inc' Text |
| 108 |
' ' Text |
| 109 |
'(' Punctuation |
| 110 |
'inc' Text |
| 111 |
' ' Text |
| 112 |
'100' Literal.Number.Integer |
| 113 |
')' Punctuation |
| 114 |
')' Punctuation |
| 115 |
'\n\n' Text |
| 116 |
|
| 117 |
'{' Punctuation |
| 118 |
' ' Text |
| 119 |
'x' Text |
| 120 |
',' Punctuation |
| 121 |
' ' Text |
| 122 |
'y' Text |
| 123 |
' ' Text |
| 124 |
'}' Punctuation |
| 125 |
':' Punctuation |
| 126 |
' ' Text |
| 127 |
'x' Text |
| 128 |
' ' Text |
| 129 |
'+' Operator |
| 130 |
' ' Text |
| 131 |
'y' Text |
| 132 |
'\n\n' Text |
| 133 |
|
| 134 |
'{' Punctuation |
| 135 |
' ' Text |
| 136 |
'x' Text |
| 137 |
',' Punctuation |
| 138 |
' ' Text |
| 139 |
'y' Text |
| 140 |
' ' Text |
| 141 |
'?' Operator |
| 142 |
' ' Text |
| 143 |
'"' Literal.String.Double |
| 144 |
'bar' Literal.String.Double |
| 145 |
'"' Literal.String.Double |
| 146 |
' ' Text |
| 147 |
'}' Punctuation |
| 148 |
':' Punctuation |
| 149 |
' ' Text |
| 150 |
'x' Text |
| 151 |
' ' Text |
| 152 |
'+' Operator |
| 153 |
' ' Text |
| 154 |
'y' Text |
| 155 |
'\n\n' Text |
| 156 |
|
| 157 |
'{' Punctuation |
| 158 |
' ' Text |
| 159 |
'x' Text |
| 160 |
',' Punctuation |
| 161 |
' ' Text |
| 162 |
'y' Text |
| 163 |
',' Punctuation |
| 164 |
' ' Text |
| 165 |
'.' Operator |
| 166 |
'.' Operator |
| 167 |
'.' Operator |
| 168 |
' ' Text |
| 169 |
'}' Punctuation |
| 170 |
':' Punctuation |
| 171 |
' ' Text |
| 172 |
'x' Text |
| 173 |
' ' Text |
| 174 |
'+' Operator |
| 175 |
' ' Text |
| 176 |
'y' Text |
| 177 |
'\n\n' Text |
| 178 |
|
| 179 |
'{' Punctuation |
| 180 |
' ' Text |
| 181 |
'x' Text |
| 182 |
',' Punctuation |
| 183 |
' ' Text |
| 184 |
'y' Text |
| 185 |
' ' Text |
| 186 |
'}' Punctuation |
| 187 |
' ' Text |
| 188 |
'@' Punctuation |
| 189 |
' ' Text |
| 190 |
'args' Text |
| 191 |
':' Punctuation |
| 192 |
' ' Text |
| 193 |
'x' Text |
| 194 |
' ' Text |
| 195 |
'+' Operator |
| 196 |
' ' Text |
| 197 |
'y' Text |
| 198 |
'\n\n' Text |
| 199 |
|
| 200 |
'args' Text |
| 201 |
' ' Text |
| 202 |
'@' Punctuation |
| 203 |
' ' Text |
| 204 |
'{' Punctuation |
| 205 |
' ' Text |
| 206 |
'x' Text |
| 207 |
',' Punctuation |
| 208 |
' ' Text |
| 209 |
'y' Text |
| 210 |
' ' Text |
| 211 |
'}' Punctuation |
| 212 |
':' Punctuation |
| 213 |
' ' Text |
| 214 |
'x' Text |
| 215 |
' ' Text |
| 216 |
'+' Operator |
| 217 |
' ' Text |
| 218 |
'y' Text |
| 219 |
'\n' Text |