tree-sitter-delphi13-pure 1.4.0 → 1.4.2
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 +26 -2
- package/package.json +58 -58
- package/prebuilds/darwin-arm64/tree-sitter-delphi13-pure.node +0 -0
- package/prebuilds/darwin-x64/tree-sitter-delphi13-pure.node +0 -0
- package/prebuilds/linux-x64/tree-sitter-delphi13-pure.node +0 -0
- package/prebuilds/win32-x64/tree-sitter-delphi13-pure.node +0 -0
- package/src/grammar.json +181 -0
- package/src/node-types.json +4 -0
- package/src/parser.c +307745 -305078
- package/tree-sitter-delphi13_pure.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -423,6 +423,10 @@ module.exports = grammar({
|
|
|
423
423
|
// Phase 3b iter 11: declFieldNoSemi uses a narrower type set; conflicts
|
|
424
424
|
// with the full `type` rule's choices.
|
|
425
425
|
[$.type, $.declFieldNoSemi],
|
|
426
|
+
// 2026-11-03 GRAMMAR-LASTFIELD: the no-semi array form shares its prefix with
|
|
427
|
+
// declArray; the GLR splits on the token after the element (`;` vs `end`).
|
|
428
|
+
[$.type, $._arrayElemNoSemi],
|
|
429
|
+
[$.declArray, $._declArrayNoSemi],
|
|
426
430
|
// Ported from root v1.1.x: anon enum in array index vs paren expr.
|
|
427
431
|
[$._ref, $.declEnumValue],
|
|
428
432
|
// Ported from root v1.1.x: per-name param attributes in a shared group.
|
|
@@ -1564,11 +1568,31 @@ module.exports = grammar({
|
|
|
1564
1568
|
// without re-introducing the iPLANLIST `string[30]` regression
|
|
1565
1569
|
// (declField with `;` is preferred when `[N]` follows).
|
|
1566
1570
|
alias($.kString, $.typeref),
|
|
1567
|
-
// (
|
|
1568
|
-
//
|
|
1571
|
+
// 2026-11-03 (v1.4.1, GRAMMAR-LASTFIELD): `array[...] of T` as the
|
|
1572
|
+
// last field with no `;` (MongoDBCli, ShlObj). The full declArray
|
|
1573
|
+
// broke ORM3 Z19b5.pas `Array[0..4] of String[1];`; the
|
|
1574
|
+
// constrained _declArrayNoSemi excludes string elements, aliased
|
|
1575
|
+
// to declArray so the tree matches the `;` form. Same as root.
|
|
1576
|
+
alias($._declArrayNoSemi, $.declArray),
|
|
1569
1577
|
)),
|
|
1570
1578
|
field('defaultValue', optional($.defaultValue)),
|
|
1571
1579
|
),
|
|
1580
|
+
// Constrained `array [..] of T` for declFieldNoSemi only (see there).
|
|
1581
|
+
_declArrayNoSemi: $ => seq(
|
|
1582
|
+
optional($.kPacked),
|
|
1583
|
+
$.kArray,
|
|
1584
|
+
optional(seq('[', delimited(choice($.range, $.declEnum, $._expr)), ']')),
|
|
1585
|
+
$.kOf,
|
|
1586
|
+
choice(alias($._arrayElemNoSemi, $.type), $.subrangeType),
|
|
1587
|
+
),
|
|
1588
|
+
_arrayElemNoSemi: $ => choice(
|
|
1589
|
+
$.typeref,
|
|
1590
|
+
$.declMetaClass,
|
|
1591
|
+
$.declEnum,
|
|
1592
|
+
$.declSet,
|
|
1593
|
+
$.declProcRef,
|
|
1594
|
+
$.declClass,
|
|
1595
|
+
),
|
|
1572
1596
|
|
|
1573
1597
|
declField: $ => seq(
|
|
1574
1598
|
...enable_if(rtti, optional($.rttiAttributes)),
|
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "tree-sitter-delphi13-pure",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "Pure Delphi 13 tree-sitter sub-grammar — drops {$IFDEF}/pp_* tokens entirely and expects preprocessor-resolved source as input. Pairs with delphi13-preprocessor to reach 99%+ pass on real Delphi 13 corpora.",
|
|
5
|
-
"main": "bindings/node",
|
|
6
|
-
"types": "bindings/node",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/Alexl-git/tree-sitter-delphi13.git",
|
|
10
|
-
"directory": "pure"
|
|
11
|
-
},
|
|
12
|
-
"homepage": "https://github.com/Alexl-git/tree-sitter-delphi13/tree/master/pure",
|
|
13
|
-
"bugs": {
|
|
14
|
-
"url": "https://github.com/Alexl-git/tree-sitter-delphi13/issues"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [
|
|
17
|
-
"parser",
|
|
18
|
-
"tree-sitter",
|
|
19
|
-
"delphi",
|
|
20
|
-
"delphi13",
|
|
21
|
-
"pascal",
|
|
22
|
-
"pure-grammar"
|
|
23
|
-
],
|
|
24
|
-
"author": "Alexander Liberov",
|
|
25
|
-
"license": "MIT",
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"prebuildify": "^6.0.1",
|
|
28
|
-
"tree-sitter-cli": "^0.24.5"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "tree-sitter generate && node-gyp build",
|
|
32
|
-
"build-wasm": "tree-sitter build --wasm -o tree-sitter-delphi13_pure.wasm .",
|
|
33
|
-
"install": "node-gyp-build",
|
|
34
|
-
"prebuildify": "prebuildify --napi --strip"
|
|
35
|
-
},
|
|
36
|
-
"files": [
|
|
37
|
-
"grammar.js",
|
|
38
|
-
"binding.gyp",
|
|
39
|
-
"tree-sitter.json",
|
|
40
|
-
"prebuilds/**",
|
|
41
|
-
"bindings/node/*",
|
|
42
|
-
"queries/*",
|
|
43
|
-
"src/**",
|
|
44
|
-
"tree-sitter-delphi13_pure.wasm"
|
|
45
|
-
],
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"node-gyp-build": "^4.8.4"
|
|
48
|
-
},
|
|
49
|
-
"peerDependencies": {
|
|
50
|
-
"tree-sitter": "^0.22.0",
|
|
51
|
-
"delphi13-preprocessor": "^1.0.0"
|
|
52
|
-
},
|
|
53
|
-
"peerDependenciesMeta": {
|
|
54
|
-
"tree_sitter": {
|
|
55
|
-
"optional": true
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "tree-sitter-delphi13-pure",
|
|
3
|
+
"version": "1.4.2",
|
|
4
|
+
"description": "Pure Delphi 13 tree-sitter sub-grammar — drops {$IFDEF}/pp_* tokens entirely and expects preprocessor-resolved source as input. Pairs with delphi13-preprocessor to reach 99%+ pass on real Delphi 13 corpora.",
|
|
5
|
+
"main": "bindings/node",
|
|
6
|
+
"types": "bindings/node",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Alexl-git/tree-sitter-delphi13.git",
|
|
10
|
+
"directory": "pure"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/Alexl-git/tree-sitter-delphi13/tree/master/pure",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Alexl-git/tree-sitter-delphi13/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"parser",
|
|
18
|
+
"tree-sitter",
|
|
19
|
+
"delphi",
|
|
20
|
+
"delphi13",
|
|
21
|
+
"pascal",
|
|
22
|
+
"pure-grammar"
|
|
23
|
+
],
|
|
24
|
+
"author": "Alexander Liberov",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"prebuildify": "^6.0.1",
|
|
28
|
+
"tree-sitter-cli": "^0.24.5"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tree-sitter generate && node-gyp build",
|
|
32
|
+
"build-wasm": "tree-sitter build --wasm -o tree-sitter-delphi13_pure.wasm .",
|
|
33
|
+
"install": "node-gyp-build",
|
|
34
|
+
"prebuildify": "prebuildify --napi --strip"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"grammar.js",
|
|
38
|
+
"binding.gyp",
|
|
39
|
+
"tree-sitter.json",
|
|
40
|
+
"prebuilds/**",
|
|
41
|
+
"bindings/node/*",
|
|
42
|
+
"queries/*",
|
|
43
|
+
"src/**",
|
|
44
|
+
"tree-sitter-delphi13_pure.wasm"
|
|
45
|
+
],
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"node-gyp-build": "^4.8.4"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"tree-sitter": "^0.22.0",
|
|
51
|
+
"delphi13-preprocessor": "^1.0.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"tree_sitter": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/grammar.json
CHANGED
|
@@ -9599,6 +9599,15 @@
|
|
|
9599
9599
|
},
|
|
9600
9600
|
"named": true,
|
|
9601
9601
|
"value": "typeref"
|
|
9602
|
+
},
|
|
9603
|
+
{
|
|
9604
|
+
"type": "ALIAS",
|
|
9605
|
+
"content": {
|
|
9606
|
+
"type": "SYMBOL",
|
|
9607
|
+
"name": "_declArrayNoSemi"
|
|
9608
|
+
},
|
|
9609
|
+
"named": true,
|
|
9610
|
+
"value": "declArray"
|
|
9602
9611
|
}
|
|
9603
9612
|
]
|
|
9604
9613
|
}
|
|
@@ -9621,6 +9630,170 @@
|
|
|
9621
9630
|
}
|
|
9622
9631
|
]
|
|
9623
9632
|
},
|
|
9633
|
+
"_declArrayNoSemi": {
|
|
9634
|
+
"type": "SEQ",
|
|
9635
|
+
"members": [
|
|
9636
|
+
{
|
|
9637
|
+
"type": "CHOICE",
|
|
9638
|
+
"members": [
|
|
9639
|
+
{
|
|
9640
|
+
"type": "SYMBOL",
|
|
9641
|
+
"name": "kPacked"
|
|
9642
|
+
},
|
|
9643
|
+
{
|
|
9644
|
+
"type": "BLANK"
|
|
9645
|
+
}
|
|
9646
|
+
]
|
|
9647
|
+
},
|
|
9648
|
+
{
|
|
9649
|
+
"type": "SYMBOL",
|
|
9650
|
+
"name": "kArray"
|
|
9651
|
+
},
|
|
9652
|
+
{
|
|
9653
|
+
"type": "CHOICE",
|
|
9654
|
+
"members": [
|
|
9655
|
+
{
|
|
9656
|
+
"type": "SEQ",
|
|
9657
|
+
"members": [
|
|
9658
|
+
{
|
|
9659
|
+
"type": "STRING",
|
|
9660
|
+
"value": "["
|
|
9661
|
+
},
|
|
9662
|
+
{
|
|
9663
|
+
"type": "CHOICE",
|
|
9664
|
+
"members": [
|
|
9665
|
+
{
|
|
9666
|
+
"type": "SEQ",
|
|
9667
|
+
"members": [
|
|
9668
|
+
{
|
|
9669
|
+
"type": "CHOICE",
|
|
9670
|
+
"members": [
|
|
9671
|
+
{
|
|
9672
|
+
"type": "REPEAT1",
|
|
9673
|
+
"content": {
|
|
9674
|
+
"type": "PREC",
|
|
9675
|
+
"value": 0,
|
|
9676
|
+
"content": {
|
|
9677
|
+
"type": "SEQ",
|
|
9678
|
+
"members": [
|
|
9679
|
+
{
|
|
9680
|
+
"type": "CHOICE",
|
|
9681
|
+
"members": [
|
|
9682
|
+
{
|
|
9683
|
+
"type": "SYMBOL",
|
|
9684
|
+
"name": "range"
|
|
9685
|
+
},
|
|
9686
|
+
{
|
|
9687
|
+
"type": "SYMBOL",
|
|
9688
|
+
"name": "declEnum"
|
|
9689
|
+
},
|
|
9690
|
+
{
|
|
9691
|
+
"type": "SYMBOL",
|
|
9692
|
+
"name": "_expr"
|
|
9693
|
+
}
|
|
9694
|
+
]
|
|
9695
|
+
},
|
|
9696
|
+
{
|
|
9697
|
+
"type": "STRING",
|
|
9698
|
+
"value": ","
|
|
9699
|
+
}
|
|
9700
|
+
]
|
|
9701
|
+
}
|
|
9702
|
+
}
|
|
9703
|
+
},
|
|
9704
|
+
{
|
|
9705
|
+
"type": "BLANK"
|
|
9706
|
+
}
|
|
9707
|
+
]
|
|
9708
|
+
},
|
|
9709
|
+
{
|
|
9710
|
+
"type": "CHOICE",
|
|
9711
|
+
"members": [
|
|
9712
|
+
{
|
|
9713
|
+
"type": "SYMBOL",
|
|
9714
|
+
"name": "range"
|
|
9715
|
+
},
|
|
9716
|
+
{
|
|
9717
|
+
"type": "SYMBOL",
|
|
9718
|
+
"name": "declEnum"
|
|
9719
|
+
},
|
|
9720
|
+
{
|
|
9721
|
+
"type": "SYMBOL",
|
|
9722
|
+
"name": "_expr"
|
|
9723
|
+
}
|
|
9724
|
+
]
|
|
9725
|
+
}
|
|
9726
|
+
]
|
|
9727
|
+
},
|
|
9728
|
+
{
|
|
9729
|
+
"type": "BLANK"
|
|
9730
|
+
}
|
|
9731
|
+
]
|
|
9732
|
+
},
|
|
9733
|
+
{
|
|
9734
|
+
"type": "STRING",
|
|
9735
|
+
"value": "]"
|
|
9736
|
+
}
|
|
9737
|
+
]
|
|
9738
|
+
},
|
|
9739
|
+
{
|
|
9740
|
+
"type": "BLANK"
|
|
9741
|
+
}
|
|
9742
|
+
]
|
|
9743
|
+
},
|
|
9744
|
+
{
|
|
9745
|
+
"type": "SYMBOL",
|
|
9746
|
+
"name": "kOf"
|
|
9747
|
+
},
|
|
9748
|
+
{
|
|
9749
|
+
"type": "CHOICE",
|
|
9750
|
+
"members": [
|
|
9751
|
+
{
|
|
9752
|
+
"type": "ALIAS",
|
|
9753
|
+
"content": {
|
|
9754
|
+
"type": "SYMBOL",
|
|
9755
|
+
"name": "_arrayElemNoSemi"
|
|
9756
|
+
},
|
|
9757
|
+
"named": true,
|
|
9758
|
+
"value": "type"
|
|
9759
|
+
},
|
|
9760
|
+
{
|
|
9761
|
+
"type": "SYMBOL",
|
|
9762
|
+
"name": "subrangeType"
|
|
9763
|
+
}
|
|
9764
|
+
]
|
|
9765
|
+
}
|
|
9766
|
+
]
|
|
9767
|
+
},
|
|
9768
|
+
"_arrayElemNoSemi": {
|
|
9769
|
+
"type": "CHOICE",
|
|
9770
|
+
"members": [
|
|
9771
|
+
{
|
|
9772
|
+
"type": "SYMBOL",
|
|
9773
|
+
"name": "typeref"
|
|
9774
|
+
},
|
|
9775
|
+
{
|
|
9776
|
+
"type": "SYMBOL",
|
|
9777
|
+
"name": "declMetaClass"
|
|
9778
|
+
},
|
|
9779
|
+
{
|
|
9780
|
+
"type": "SYMBOL",
|
|
9781
|
+
"name": "declEnum"
|
|
9782
|
+
},
|
|
9783
|
+
{
|
|
9784
|
+
"type": "SYMBOL",
|
|
9785
|
+
"name": "declSet"
|
|
9786
|
+
},
|
|
9787
|
+
{
|
|
9788
|
+
"type": "SYMBOL",
|
|
9789
|
+
"name": "declProcRef"
|
|
9790
|
+
},
|
|
9791
|
+
{
|
|
9792
|
+
"type": "SYMBOL",
|
|
9793
|
+
"name": "declClass"
|
|
9794
|
+
}
|
|
9795
|
+
]
|
|
9796
|
+
},
|
|
9624
9797
|
"declField": {
|
|
9625
9798
|
"type": "SEQ",
|
|
9626
9799
|
"members": [
|
|
@@ -13147,6 +13320,14 @@
|
|
|
13147
13320
|
"type",
|
|
13148
13321
|
"declFieldNoSemi"
|
|
13149
13322
|
],
|
|
13323
|
+
[
|
|
13324
|
+
"type",
|
|
13325
|
+
"_arrayElemNoSemi"
|
|
13326
|
+
],
|
|
13327
|
+
[
|
|
13328
|
+
"declArray",
|
|
13329
|
+
"_declArrayNoSemi"
|
|
13330
|
+
],
|
|
13150
13331
|
[
|
|
13151
13332
|
"_ref",
|
|
13152
13333
|
"declEnumValue"
|