tree-sitter-rake 0.4.0-beta → 0.5.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/grammar.js +21 -3
- package/package.json +4 -4
- package/src/grammar.json +145 -6
- package/src/node-types.json +91 -16
- package/src/parser.c +25506 -11916
package/grammar.js
CHANGED
|
@@ -95,7 +95,7 @@ export default grammar({
|
|
|
95
95
|
repeat(seq($.let_statement, $._newline)),
|
|
96
96
|
repeat1($.tine_declaration),
|
|
97
97
|
repeat1($.through_statement),
|
|
98
|
-
$.
|
|
98
|
+
$.sweep_statement,
|
|
99
99
|
$._dedent,
|
|
100
100
|
),
|
|
101
101
|
|
|
@@ -411,8 +411,7 @@ export default grammar({
|
|
|
411
411
|
$.boolean_literal,
|
|
412
412
|
),
|
|
413
413
|
|
|
414
|
-
|
|
415
|
-
'return',
|
|
414
|
+
sweep_statement: $ => seq(
|
|
416
415
|
'sweep',
|
|
417
416
|
':',
|
|
418
417
|
$._newline,
|
|
@@ -430,12 +429,31 @@ export default grammar({
|
|
|
430
429
|
),
|
|
431
430
|
|
|
432
431
|
expression: $ => choice(
|
|
432
|
+
$.slow_block,
|
|
433
433
|
$.conditional_expression,
|
|
434
434
|
$.binary_expression,
|
|
435
435
|
$.unary_expression,
|
|
436
436
|
$._postfix_expression,
|
|
437
437
|
),
|
|
438
438
|
|
|
439
|
+
slow_block: $ => seq(
|
|
440
|
+
'slow', '{',
|
|
441
|
+
choice(
|
|
442
|
+
optional($._slow_contents),
|
|
443
|
+
$._newline,
|
|
444
|
+
seq($._newline, $._indent, optional($._slow_contents), $._dedent),
|
|
445
|
+
),
|
|
446
|
+
'}',
|
|
447
|
+
),
|
|
448
|
+
|
|
449
|
+
_slow_contents: $ => choice(seq(
|
|
450
|
+
repeat1(choice(
|
|
451
|
+
seq($._simple_statement, choice($._newline, seq(';', repeat($._newline)))),
|
|
452
|
+
$._compound_statement,
|
|
453
|
+
)),
|
|
454
|
+
optional($._simple_statement),
|
|
455
|
+
), $._simple_statement),
|
|
456
|
+
|
|
439
457
|
_postfix_expression: $ => choice(
|
|
440
458
|
$.field_expression,
|
|
441
459
|
$.index_expression,
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tree-sitter-rake",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-beta",
|
|
4
4
|
"description": "Tree-sitter grammar for Rake, a vector-first SIMD language",
|
|
5
|
-
"main": "bindings/node",
|
|
6
|
-
"types": "bindings/node",
|
|
5
|
+
"main": "bindings/node/index.js",
|
|
6
|
+
"types": "bindings/node/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"files": [
|
|
9
9
|
"binding.gyp",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/rakelang/tree-sitter-rake.git"
|
|
17
|
+
"url": "git+https://github.com/rakelang/tree-sitter-rake.git"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"tree-sitter",
|
package/src/grammar.json
CHANGED
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
},
|
|
423
423
|
{
|
|
424
424
|
"type": "SYMBOL",
|
|
425
|
-
"name": "
|
|
425
|
+
"name": "sweep_statement"
|
|
426
426
|
},
|
|
427
427
|
{
|
|
428
428
|
"type": "SYMBOL",
|
|
@@ -2350,13 +2350,9 @@
|
|
|
2350
2350
|
}
|
|
2351
2351
|
]
|
|
2352
2352
|
},
|
|
2353
|
-
"
|
|
2353
|
+
"sweep_statement": {
|
|
2354
2354
|
"type": "SEQ",
|
|
2355
2355
|
"members": [
|
|
2356
|
-
{
|
|
2357
|
-
"type": "STRING",
|
|
2358
|
-
"value": "return"
|
|
2359
|
-
},
|
|
2360
2356
|
{
|
|
2361
2357
|
"type": "STRING",
|
|
2362
2358
|
"value": "sweep"
|
|
@@ -2431,6 +2427,10 @@
|
|
|
2431
2427
|
"expression": {
|
|
2432
2428
|
"type": "CHOICE",
|
|
2433
2429
|
"members": [
|
|
2430
|
+
{
|
|
2431
|
+
"type": "SYMBOL",
|
|
2432
|
+
"name": "slow_block"
|
|
2433
|
+
},
|
|
2434
2434
|
{
|
|
2435
2435
|
"type": "SYMBOL",
|
|
2436
2436
|
"name": "conditional_expression"
|
|
@@ -2449,6 +2449,145 @@
|
|
|
2449
2449
|
}
|
|
2450
2450
|
]
|
|
2451
2451
|
},
|
|
2452
|
+
"slow_block": {
|
|
2453
|
+
"type": "SEQ",
|
|
2454
|
+
"members": [
|
|
2455
|
+
{
|
|
2456
|
+
"type": "STRING",
|
|
2457
|
+
"value": "slow"
|
|
2458
|
+
},
|
|
2459
|
+
{
|
|
2460
|
+
"type": "STRING",
|
|
2461
|
+
"value": "{"
|
|
2462
|
+
},
|
|
2463
|
+
{
|
|
2464
|
+
"type": "CHOICE",
|
|
2465
|
+
"members": [
|
|
2466
|
+
{
|
|
2467
|
+
"type": "CHOICE",
|
|
2468
|
+
"members": [
|
|
2469
|
+
{
|
|
2470
|
+
"type": "SYMBOL",
|
|
2471
|
+
"name": "_slow_contents"
|
|
2472
|
+
},
|
|
2473
|
+
{
|
|
2474
|
+
"type": "BLANK"
|
|
2475
|
+
}
|
|
2476
|
+
]
|
|
2477
|
+
},
|
|
2478
|
+
{
|
|
2479
|
+
"type": "SYMBOL",
|
|
2480
|
+
"name": "_newline"
|
|
2481
|
+
},
|
|
2482
|
+
{
|
|
2483
|
+
"type": "SEQ",
|
|
2484
|
+
"members": [
|
|
2485
|
+
{
|
|
2486
|
+
"type": "SYMBOL",
|
|
2487
|
+
"name": "_newline"
|
|
2488
|
+
},
|
|
2489
|
+
{
|
|
2490
|
+
"type": "SYMBOL",
|
|
2491
|
+
"name": "_indent"
|
|
2492
|
+
},
|
|
2493
|
+
{
|
|
2494
|
+
"type": "CHOICE",
|
|
2495
|
+
"members": [
|
|
2496
|
+
{
|
|
2497
|
+
"type": "SYMBOL",
|
|
2498
|
+
"name": "_slow_contents"
|
|
2499
|
+
},
|
|
2500
|
+
{
|
|
2501
|
+
"type": "BLANK"
|
|
2502
|
+
}
|
|
2503
|
+
]
|
|
2504
|
+
},
|
|
2505
|
+
{
|
|
2506
|
+
"type": "SYMBOL",
|
|
2507
|
+
"name": "_dedent"
|
|
2508
|
+
}
|
|
2509
|
+
]
|
|
2510
|
+
}
|
|
2511
|
+
]
|
|
2512
|
+
},
|
|
2513
|
+
{
|
|
2514
|
+
"type": "STRING",
|
|
2515
|
+
"value": "}"
|
|
2516
|
+
}
|
|
2517
|
+
]
|
|
2518
|
+
},
|
|
2519
|
+
"_slow_contents": {
|
|
2520
|
+
"type": "CHOICE",
|
|
2521
|
+
"members": [
|
|
2522
|
+
{
|
|
2523
|
+
"type": "SEQ",
|
|
2524
|
+
"members": [
|
|
2525
|
+
{
|
|
2526
|
+
"type": "REPEAT1",
|
|
2527
|
+
"content": {
|
|
2528
|
+
"type": "CHOICE",
|
|
2529
|
+
"members": [
|
|
2530
|
+
{
|
|
2531
|
+
"type": "SEQ",
|
|
2532
|
+
"members": [
|
|
2533
|
+
{
|
|
2534
|
+
"type": "SYMBOL",
|
|
2535
|
+
"name": "_simple_statement"
|
|
2536
|
+
},
|
|
2537
|
+
{
|
|
2538
|
+
"type": "CHOICE",
|
|
2539
|
+
"members": [
|
|
2540
|
+
{
|
|
2541
|
+
"type": "SYMBOL",
|
|
2542
|
+
"name": "_newline"
|
|
2543
|
+
},
|
|
2544
|
+
{
|
|
2545
|
+
"type": "SEQ",
|
|
2546
|
+
"members": [
|
|
2547
|
+
{
|
|
2548
|
+
"type": "STRING",
|
|
2549
|
+
"value": ";"
|
|
2550
|
+
},
|
|
2551
|
+
{
|
|
2552
|
+
"type": "REPEAT",
|
|
2553
|
+
"content": {
|
|
2554
|
+
"type": "SYMBOL",
|
|
2555
|
+
"name": "_newline"
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
]
|
|
2559
|
+
}
|
|
2560
|
+
]
|
|
2561
|
+
}
|
|
2562
|
+
]
|
|
2563
|
+
},
|
|
2564
|
+
{
|
|
2565
|
+
"type": "SYMBOL",
|
|
2566
|
+
"name": "_compound_statement"
|
|
2567
|
+
}
|
|
2568
|
+
]
|
|
2569
|
+
}
|
|
2570
|
+
},
|
|
2571
|
+
{
|
|
2572
|
+
"type": "CHOICE",
|
|
2573
|
+
"members": [
|
|
2574
|
+
{
|
|
2575
|
+
"type": "SYMBOL",
|
|
2576
|
+
"name": "_simple_statement"
|
|
2577
|
+
},
|
|
2578
|
+
{
|
|
2579
|
+
"type": "BLANK"
|
|
2580
|
+
}
|
|
2581
|
+
]
|
|
2582
|
+
}
|
|
2583
|
+
]
|
|
2584
|
+
},
|
|
2585
|
+
{
|
|
2586
|
+
"type": "SYMBOL",
|
|
2587
|
+
"name": "_simple_statement"
|
|
2588
|
+
}
|
|
2589
|
+
]
|
|
2590
|
+
},
|
|
2452
2591
|
"_postfix_expression": {
|
|
2453
2592
|
"type": "CHOICE",
|
|
2454
2593
|
"members": [
|
package/src/node-types.json
CHANGED
|
@@ -546,6 +546,10 @@
|
|
|
546
546
|
"type": "shuffle_expression",
|
|
547
547
|
"named": true
|
|
548
548
|
},
|
|
549
|
+
{
|
|
550
|
+
"type": "slow_block",
|
|
551
|
+
"named": true
|
|
552
|
+
},
|
|
549
553
|
{
|
|
550
554
|
"type": "static_move_expression",
|
|
551
555
|
"named": true
|
|
@@ -1373,7 +1377,7 @@
|
|
|
1373
1377
|
"named": true
|
|
1374
1378
|
},
|
|
1375
1379
|
{
|
|
1376
|
-
"type": "
|
|
1380
|
+
"type": "sweep_statement",
|
|
1377
1381
|
"named": true
|
|
1378
1382
|
},
|
|
1379
1383
|
{
|
|
@@ -1601,21 +1605,6 @@
|
|
|
1601
1605
|
}
|
|
1602
1606
|
}
|
|
1603
1607
|
},
|
|
1604
|
-
{
|
|
1605
|
-
"type": "return_sweep_statement",
|
|
1606
|
-
"named": true,
|
|
1607
|
-
"fields": {},
|
|
1608
|
-
"children": {
|
|
1609
|
-
"multiple": true,
|
|
1610
|
-
"required": true,
|
|
1611
|
-
"types": [
|
|
1612
|
-
{
|
|
1613
|
-
"type": "sweep_arm",
|
|
1614
|
-
"named": true
|
|
1615
|
-
}
|
|
1616
|
-
]
|
|
1617
|
-
}
|
|
1618
|
-
},
|
|
1619
1608
|
{
|
|
1620
1609
|
"type": "run_definition",
|
|
1621
1610
|
"named": true,
|
|
@@ -1855,6 +1844,77 @@
|
|
|
1855
1844
|
}
|
|
1856
1845
|
}
|
|
1857
1846
|
},
|
|
1847
|
+
{
|
|
1848
|
+
"type": "slow_block",
|
|
1849
|
+
"named": true,
|
|
1850
|
+
"fields": {},
|
|
1851
|
+
"children": {
|
|
1852
|
+
"multiple": true,
|
|
1853
|
+
"required": false,
|
|
1854
|
+
"types": [
|
|
1855
|
+
{
|
|
1856
|
+
"type": "assignment_statement",
|
|
1857
|
+
"named": true
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
"type": "break_statement",
|
|
1861
|
+
"named": true
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
"type": "continue_statement",
|
|
1865
|
+
"named": true
|
|
1866
|
+
},
|
|
1867
|
+
{
|
|
1868
|
+
"type": "expression_statement",
|
|
1869
|
+
"named": true
|
|
1870
|
+
},
|
|
1871
|
+
{
|
|
1872
|
+
"type": "for_statement",
|
|
1873
|
+
"named": true
|
|
1874
|
+
},
|
|
1875
|
+
{
|
|
1876
|
+
"type": "fused_binding",
|
|
1877
|
+
"named": true
|
|
1878
|
+
},
|
|
1879
|
+
{
|
|
1880
|
+
"type": "if_statement",
|
|
1881
|
+
"named": true
|
|
1882
|
+
},
|
|
1883
|
+
{
|
|
1884
|
+
"type": "let_statement",
|
|
1885
|
+
"named": true
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
"type": "mutable_binding",
|
|
1889
|
+
"named": true
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
"type": "repeat_statement",
|
|
1893
|
+
"named": true
|
|
1894
|
+
},
|
|
1895
|
+
{
|
|
1896
|
+
"type": "return_statement",
|
|
1897
|
+
"named": true
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
"type": "traversal_statement",
|
|
1901
|
+
"named": true
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
"type": "uniform_binding",
|
|
1905
|
+
"named": true
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
"type": "while_statement",
|
|
1909
|
+
"named": true
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
"type": "yield_statement",
|
|
1913
|
+
"named": true
|
|
1914
|
+
}
|
|
1915
|
+
]
|
|
1916
|
+
}
|
|
1917
|
+
},
|
|
1858
1918
|
{
|
|
1859
1919
|
"type": "slow_definition",
|
|
1860
1920
|
"named": true,
|
|
@@ -2168,6 +2228,21 @@
|
|
|
2168
2228
|
}
|
|
2169
2229
|
}
|
|
2170
2230
|
},
|
|
2231
|
+
{
|
|
2232
|
+
"type": "sweep_statement",
|
|
2233
|
+
"named": true,
|
|
2234
|
+
"fields": {},
|
|
2235
|
+
"children": {
|
|
2236
|
+
"multiple": true,
|
|
2237
|
+
"required": true,
|
|
2238
|
+
"types": [
|
|
2239
|
+
{
|
|
2240
|
+
"type": "sweep_arm",
|
|
2241
|
+
"named": true
|
|
2242
|
+
}
|
|
2243
|
+
]
|
|
2244
|
+
}
|
|
2245
|
+
},
|
|
2171
2246
|
{
|
|
2172
2247
|
"type": "through_statement",
|
|
2173
2248
|
"named": true,
|