| 1 |
---input--- |
| 2 |
// From the math syntax reference |
| 3 |
$x^2$ |
| 4 |
$ x^2 $ |
| 5 |
$x_1$ |
| 6 |
$x^2$ |
| 7 |
$1 + (a+b)/5$ |
| 8 |
$x \ y$ |
| 9 |
$x &= 2 \ &= 3$ |
| 10 |
$#x$ |
| 11 |
$pi$ |
| 12 |
$arrow.r.long$ |
| 13 |
$x y$ |
| 14 |
$->$, $!=$ |
| 15 |
$a "is natural"$ |
| 16 |
$floor(x)$ |
| 17 |
$#rect(width: 1cm)$ |
| 18 |
$x\^2$ |
| 19 |
$/* comment */$ |
| 20 |
|
| 21 |
// From the math overview |
| 22 |
$ A = pi r^2 $ |
| 23 |
$ "area" = pi dot "radius"^2 $ |
| 24 |
$ cal(A) := |
| 25 |
{ x in RR | x "is natural" } $ |
| 26 |
#let x = 5 |
| 27 |
$ #x < 17 $ |
| 28 |
$ x < y => x gt.eq.not y $ |
| 29 |
$ sum_(k=0)^n k |
| 30 |
&= 1 + ... + n \ |
| 31 |
&= (n(n+1)) / 2 $ |
| 32 |
$ frac(a^2, 2) $ |
| 33 |
$ vec(1, 2, delim: "[") $ |
| 34 |
$ mat(1, 2; 3, 4) $ |
| 35 |
$ lim_x = |
| 36 |
op("lim", limits: #true)_x $ |
| 37 |
|
| 38 |
---tokens--- |
| 39 |
'// From the math syntax reference' Comment.Single |
| 40 |
'\n' Text.Whitespace |
| 41 |
|
| 42 |
'$' Punctuation |
| 43 |
'x' Name.Variable |
| 44 |
'^' Punctuation |
| 45 |
'2' Literal.Number |
| 46 |
'$' Punctuation |
| 47 |
'\n' Text.Whitespace |
| 48 |
|
| 49 |
'$' Punctuation |
| 50 |
' ' Text.Whitespace |
| 51 |
'x' Name.Variable |
| 52 |
'^' Punctuation |
| 53 |
'2' Literal.Number |
| 54 |
' ' Text.Whitespace |
| 55 |
'$' Punctuation |
| 56 |
'\n' Text.Whitespace |
| 57 |
|
| 58 |
'$' Punctuation |
| 59 |
'x' Name.Variable |
| 60 |
'_' Punctuation |
| 61 |
'1' Literal.Number |
| 62 |
'$' Punctuation |
| 63 |
'\n' Text.Whitespace |
| 64 |
|
| 65 |
'$' Punctuation |
| 66 |
'x' Name.Variable |
| 67 |
'^' Punctuation |
| 68 |
'2' Literal.Number |
| 69 |
'$' Punctuation |
| 70 |
'\n' Text.Whitespace |
| 71 |
|
| 72 |
'$' Punctuation |
| 73 |
'1' Literal.Number |
| 74 |
' ' Text.Whitespace |
| 75 |
'+' Operator |
| 76 |
' ' Text.Whitespace |
| 77 |
'(' Punctuation |
| 78 |
'a' Name.Variable |
| 79 |
'+' Operator |
| 80 |
'b' Name.Variable |
| 81 |
')' Punctuation |
| 82 |
'/' Operator |
| 83 |
'5' Literal.Number |
| 84 |
'$' Punctuation |
| 85 |
'\n' Text.Whitespace |
| 86 |
|
| 87 |
'$' Punctuation |
| 88 |
'x' Name.Variable |
| 89 |
' ' Text.Whitespace |
| 90 |
'\\' Punctuation |
| 91 |
' ' Text.Whitespace |
| 92 |
'y' Name.Variable |
| 93 |
'$' Punctuation |
| 94 |
'\n' Text.Whitespace |
| 95 |
|
| 96 |
'$' Punctuation |
| 97 |
'x' Name.Variable |
| 98 |
' ' Text.Whitespace |
| 99 |
'&' Punctuation |
| 100 |
'=' Operator |
| 101 |
' ' Text.Whitespace |
| 102 |
'2' Literal.Number |
| 103 |
' ' Text.Whitespace |
| 104 |
'\\' Punctuation |
| 105 |
' ' Text.Whitespace |
| 106 |
'&' Punctuation |
| 107 |
'=' Operator |
| 108 |
' ' Text.Whitespace |
| 109 |
'3' Literal.Number |
| 110 |
'$' Punctuation |
| 111 |
'\n' Text.Whitespace |
| 112 |
|
| 113 |
'$' Punctuation |
| 114 |
'#x' Name.Variable |
| 115 |
'$' Punctuation |
| 116 |
'\n' Text.Whitespace |
| 117 |
|
| 118 |
'$' Punctuation |
| 119 |
'pi' Name.Variable |
| 120 |
'$' Punctuation |
| 121 |
'\n' Text.Whitespace |
| 122 |
|
| 123 |
'$' Punctuation |
| 124 |
'arrow' Name.Variable |
| 125 |
'.' Punctuation |
| 126 |
'r' Name.Variable |
| 127 |
'.' Punctuation |
| 128 |
'long' Name.Variable |
| 129 |
'$' Punctuation |
| 130 |
'\n' Text.Whitespace |
| 131 |
|
| 132 |
'$' Punctuation |
| 133 |
'x' Name.Variable |
| 134 |
' ' Text.Whitespace |
| 135 |
'y' Name.Variable |
| 136 |
'$' Punctuation |
| 137 |
'\n' Text.Whitespace |
| 138 |
|
| 139 |
'$' Punctuation |
| 140 |
'->' Operator |
| 141 |
'$' Punctuation |
| 142 |
',' Text |
| 143 |
' ' Text.Whitespace |
| 144 |
'$' Punctuation |
| 145 |
'!=' Operator |
| 146 |
'$' Punctuation |
| 147 |
'\n' Text.Whitespace |
| 148 |
|
| 149 |
'$' Punctuation |
| 150 |
'a' Name.Variable |
| 151 |
' ' Text.Whitespace |
| 152 |
'"is natural"' Literal.String.Double |
| 153 |
'$' Punctuation |
| 154 |
'\n' Text.Whitespace |
| 155 |
|
| 156 |
'$' Punctuation |
| 157 |
'floor' Name.Function |
| 158 |
'(' Punctuation |
| 159 |
'x' Name.Variable |
| 160 |
')' Punctuation |
| 161 |
'$' Punctuation |
| 162 |
'\n' Text.Whitespace |
| 163 |
|
| 164 |
'$' Punctuation |
| 165 |
'#rect' Name.Function |
| 166 |
'(' Punctuation |
| 167 |
'width' Name.Variable |
| 168 |
':' Punctuation |
| 169 |
' ' Text.Whitespace |
| 170 |
'1' Literal.Number |
| 171 |
'cm' Keyword.Reserved |
| 172 |
')' Punctuation |
| 173 |
'$' Punctuation |
| 174 |
'\n' Text.Whitespace |
| 175 |
|
| 176 |
'$' Punctuation |
| 177 |
'x' Name.Variable |
| 178 |
'\\^' Text |
| 179 |
'2' Literal.Number |
| 180 |
'$' Punctuation |
| 181 |
'\n' Text.Whitespace |
| 182 |
|
| 183 |
'$' Punctuation |
| 184 |
'/* comment */' Comment.Multiline |
| 185 |
'$' Punctuation |
| 186 |
'\n' Text.Whitespace |
| 187 |
|
| 188 |
'\n' Text.Whitespace |
| 189 |
|
| 190 |
'// From the math overview' Comment.Single |
| 191 |
'\n' Text.Whitespace |
| 192 |
|
| 193 |
'$' Punctuation |
| 194 |
' ' Text.Whitespace |
| 195 |
'A' Name.Variable |
| 196 |
' ' Text.Whitespace |
| 197 |
'=' Operator |
| 198 |
' ' Text.Whitespace |
| 199 |
'pi' Name.Variable |
| 200 |
' ' Text.Whitespace |
| 201 |
'r' Name.Variable |
| 202 |
'^' Punctuation |
| 203 |
'2' Literal.Number |
| 204 |
' ' Text.Whitespace |
| 205 |
'$' Punctuation |
| 206 |
'\n' Text.Whitespace |
| 207 |
|
| 208 |
'$' Punctuation |
| 209 |
' ' Text.Whitespace |
| 210 |
'"area"' Literal.String.Double |
| 211 |
' ' Text.Whitespace |
| 212 |
'=' Operator |
| 213 |
' ' Text.Whitespace |
| 214 |
'pi' Name.Variable |
| 215 |
' ' Text.Whitespace |
| 216 |
'dot' Name.Variable |
| 217 |
' ' Text.Whitespace |
| 218 |
'"radius"' Literal.String.Double |
| 219 |
'^' Punctuation |
| 220 |
'2' Literal.Number |
| 221 |
' ' Text.Whitespace |
| 222 |
'$' Punctuation |
| 223 |
'\n' Text.Whitespace |
| 224 |
|
| 225 |
'$' Punctuation |
| 226 |
' ' Text.Whitespace |
| 227 |
'cal' Name.Function |
| 228 |
'(' Punctuation |
| 229 |
'A' Name.Variable |
| 230 |
')' Punctuation |
| 231 |
' ' Text.Whitespace |
| 232 |
':=' Operator |
| 233 |
'\n ' Text.Whitespace |
| 234 |
'{' Punctuation |
| 235 |
' ' Text.Whitespace |
| 236 |
'x' Name.Variable |
| 237 |
' ' Text.Whitespace |
| 238 |
'in' Name.Variable |
| 239 |
' ' Text.Whitespace |
| 240 |
'RR' Name.Variable |
| 241 |
' ' Text.Whitespace |
| 242 |
'|' Operator |
| 243 |
' ' Text.Whitespace |
| 244 |
'x' Name.Variable |
| 245 |
' ' Text.Whitespace |
| 246 |
'"is natural"' Literal.String.Double |
| 247 |
' ' Text.Whitespace |
| 248 |
'}' Punctuation |
| 249 |
' ' Text.Whitespace |
| 250 |
'$' Punctuation |
| 251 |
'\n' Text.Whitespace |
| 252 |
|
| 253 |
'#let' Keyword.Declaration |
| 254 |
' ' Text.Whitespace |
| 255 |
'x' Name.Variable |
| 256 |
' ' Text.Whitespace |
| 257 |
'=' Operator |
| 258 |
' ' Text.Whitespace |
| 259 |
'5' Literal.Number.Integer |
| 260 |
'\n' Text.Whitespace |
| 261 |
|
| 262 |
'$' Punctuation |
| 263 |
' ' Text.Whitespace |
| 264 |
'#x' Name.Variable |
| 265 |
' ' Text.Whitespace |
| 266 |
'<' Operator |
| 267 |
' ' Text.Whitespace |
| 268 |
'17' Literal.Number |
| 269 |
' ' Text.Whitespace |
| 270 |
'$' Punctuation |
| 271 |
'\n' Text.Whitespace |
| 272 |
|
| 273 |
'$' Punctuation |
| 274 |
' ' Text.Whitespace |
| 275 |
'x' Name.Variable |
| 276 |
' ' Text.Whitespace |
| 277 |
'<' Operator |
| 278 |
' ' Text.Whitespace |
| 279 |
'y' Name.Variable |
| 280 |
' ' Text.Whitespace |
| 281 |
'=>' Operator |
| 282 |
' ' Text.Whitespace |
| 283 |
'x' Name.Variable |
| 284 |
' ' Text.Whitespace |
| 285 |
'gt' Name.Variable |
| 286 |
'.' Punctuation |
| 287 |
'eq' Name.Variable |
| 288 |
'.' Punctuation |
| 289 |
'not' Name.Variable |
| 290 |
' ' Text.Whitespace |
| 291 |
'y' Name.Variable |
| 292 |
' ' Text.Whitespace |
| 293 |
'$' Punctuation |
| 294 |
'\n' Text.Whitespace |
| 295 |
|
| 296 |
'$' Punctuation |
| 297 |
' ' Text.Whitespace |
| 298 |
'sum' Name.Variable |
| 299 |
'_' Punctuation |
| 300 |
'(' Punctuation |
| 301 |
'k' Name.Variable |
| 302 |
'=' Operator |
| 303 |
'0' Literal.Number |
| 304 |
')' Punctuation |
| 305 |
'^' Punctuation |
| 306 |
'n' Name.Variable |
| 307 |
' ' Text.Whitespace |
| 308 |
'k' Name.Variable |
| 309 |
'\n ' Text.Whitespace |
| 310 |
'&' Punctuation |
| 311 |
'=' Operator |
| 312 |
' ' Text.Whitespace |
| 313 |
'1' Literal.Number |
| 314 |
' ' Text.Whitespace |
| 315 |
'+' Operator |
| 316 |
' ' Text.Whitespace |
| 317 |
'...' Operator |
| 318 |
' ' Text.Whitespace |
| 319 |
'+' Operator |
| 320 |
' ' Text.Whitespace |
| 321 |
'n' Name.Variable |
| 322 |
' ' Text.Whitespace |
| 323 |
'\\' Punctuation |
| 324 |
'\n ' Text.Whitespace |
| 325 |
'&' Punctuation |
| 326 |
'=' Operator |
| 327 |
' ' Text.Whitespace |
| 328 |
'(' Punctuation |
| 329 |
'n' Name.Function |
| 330 |
'(' Punctuation |
| 331 |
'n' Name.Variable |
| 332 |
'+' Operator |
| 333 |
'1' Literal.Number |
| 334 |
')' Punctuation |
| 335 |
')' Punctuation |
| 336 |
' ' Text.Whitespace |
| 337 |
'/' Operator |
| 338 |
' ' Text.Whitespace |
| 339 |
'2' Literal.Number |
| 340 |
' ' Text.Whitespace |
| 341 |
'$' Punctuation |
| 342 |
'\n' Text.Whitespace |
| 343 |
|
| 344 |
'$' Punctuation |
| 345 |
' ' Text.Whitespace |
| 346 |
'frac' Name.Function |
| 347 |
'(' Punctuation |
| 348 |
'a' Name.Variable |
| 349 |
'^' Punctuation |
| 350 |
'2' Literal.Number |
| 351 |
',' Punctuation |
| 352 |
' ' Text.Whitespace |
| 353 |
'2' Literal.Number |
| 354 |
')' Punctuation |
| 355 |
' ' Text.Whitespace |
| 356 |
'$' Punctuation |
| 357 |
'\n' Text.Whitespace |
| 358 |
|
| 359 |
'$' Punctuation |
| 360 |
' ' Text.Whitespace |
| 361 |
'vec' Name.Function |
| 362 |
'(' Punctuation |
| 363 |
'1' Literal.Number |
| 364 |
',' Punctuation |
| 365 |
' ' Text.Whitespace |
| 366 |
'2' Literal.Number |
| 367 |
',' Punctuation |
| 368 |
' ' Text.Whitespace |
| 369 |
'delim' Name.Variable |
| 370 |
':' Punctuation |
| 371 |
' ' Text.Whitespace |
| 372 |
'"["' Literal.String.Double |
| 373 |
')' Punctuation |
| 374 |
' ' Text.Whitespace |
| 375 |
'$' Punctuation |
| 376 |
'\n' Text.Whitespace |
| 377 |
|
| 378 |
'$' Punctuation |
| 379 |
' ' Text.Whitespace |
| 380 |
'mat' Name.Function |
| 381 |
'(' Punctuation |
| 382 |
'1' Literal.Number |
| 383 |
',' Punctuation |
| 384 |
' ' Text.Whitespace |
| 385 |
'2' Literal.Number |
| 386 |
';' Punctuation |
| 387 |
' ' Text.Whitespace |
| 388 |
'3' Literal.Number |
| 389 |
',' Punctuation |
| 390 |
' ' Text.Whitespace |
| 391 |
'4' Literal.Number |
| 392 |
')' Punctuation |
| 393 |
' ' Text.Whitespace |
| 394 |
'$' Punctuation |
| 395 |
'\n' Text.Whitespace |
| 396 |
|
| 397 |
'$' Punctuation |
| 398 |
' ' Text.Whitespace |
| 399 |
'lim' Name.Variable |
| 400 |
'_' Punctuation |
| 401 |
'x' Name.Variable |
| 402 |
' ' Text.Whitespace |
| 403 |
'=' Operator |
| 404 |
'\n ' Text.Whitespace |
| 405 |
'op' Name.Function |
| 406 |
'(' Punctuation |
| 407 |
'"lim"' Literal.String.Double |
| 408 |
',' Punctuation |
| 409 |
' ' Text.Whitespace |
| 410 |
'limits' Name.Variable |
| 411 |
':' Punctuation |
| 412 |
' ' Text.Whitespace |
| 413 |
'#true' Keyword.Constant |
| 414 |
')' Punctuation |
| 415 |
'_' Punctuation |
| 416 |
'x' Name.Variable |
| 417 |
' ' Text.Whitespace |
| 418 |
'$' Punctuation |
| 419 |
'\n' Text.Whitespace |