tree-sitter-delphi13-pure 1.2.0 → 1.2.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 CHANGED
@@ -361,6 +361,11 @@ module.exports = grammar({
361
361
  // declProcFwd's strict groups while both are live.
362
362
  [$.procAttribute],
363
363
  [$._declProcLenient, $._procAttributeNoExt],
364
+ // Iter 2026-07-16 (Register as a field name, ported from root):
365
+ // previous field's trailing callconv vs next field's name; `;` vs `:`
366
+ // one token later decides.
367
+ [$.declFieldNoSemi, $.declField],
368
+ [$.declField],
364
369
  // Anonymous record/class types in type position conflict with the
365
370
  // type-declaration form (`type Foo = record ... end;`). Both reach
366
371
  // declClass but at different parser states.
@@ -695,7 +700,13 @@ module.exports = grammar({
695
700
  field('body', choice(tr($, 'block'), tr($, 'asm'))),
696
701
  ),
697
702
 
698
- inherited: $ => prec.right(seq($.kInherited, optional($.identifier))),
703
+ inherited: $ => prec.right(seq($.kInherited, optional(choice(
704
+ $.identifier,
705
+ // Soft keyword `at` (raise-with-address) as an INHERITED method
706
+ // name: `inherited At(Offset)` (JCL JclCLR.pas). Mirrors the root
707
+ // full grammar's fix (2026-07-17).
708
+ alias($.kAtWord, $.identifier),
709
+ )))),
699
710
 
700
711
  exprDot: $ => choice(
701
712
  op.infix(5, $._ref, $.kDot, $._ref),
@@ -848,7 +859,15 @@ module.exports = grammar({
848
859
  typeref: $ => seq(
849
860
  ...enable_if(fpc, field('_dummy', optional($.kSpecialize))),
850
861
  $._typeref,
851
- ...enable_if(delphi, optional(seq($.kDeprecated, $._expr))),
862
+ // Ported from root 2026-07-16: trailing kPlatform hint on the
863
+ // typeref — makes `Default8087CW: Word platform = $033F;`
864
+ // (System.pas x6) parse with declVar's normal defaultValue.
865
+ // Mirrors the existing kDeprecated role-set; the hint-then-value
866
+ // ARM inside declVar is a bisect-confirmed table bomb (TODO.md).
867
+ ...enable_if(delphi, optional(choice(
868
+ seq($.kDeprecated, $._expr),
869
+ $.kPlatform,
870
+ ))),
852
871
  ),
853
872
 
854
873
  _typeref: $ => choice(
@@ -1185,6 +1204,9 @@ module.exports = grammar({
1185
1204
  // conflicts with typerefDot in this position.)
1186
1205
  seq($.identifier, '.', $.identifier),
1187
1206
  seq($.identifier, '(', $.identifier, ')'),
1207
+ // Nested const-expr call bound — `2 .. Succ(High(TV))` (JCL
1208
+ // JclSysUtils). Mirrors the root full grammar's fix (2026-07-17).
1209
+ seq($.identifier, '(', seq($.identifier, '(', $.identifier, ')'), ')'),
1188
1210
  // `hid - 1`, `MaxN + 2` — narrow `identifier OP integer` form for
1189
1211
  // real-corpus patterns like `TNmbrRange = 0 .. hid - 1;`.
1190
1212
  // Kept narrow (no full _expr) to avoid the conflict cascade hit
@@ -1527,7 +1549,16 @@ module.exports = grammar({
1527
1549
 
1528
1550
  declField: $ => seq(
1529
1551
  ...enable_if(rtti, optional($.rttiAttributes)),
1530
- field('name', delimited1($.identifier)),
1552
+ // Ported from root 2026-07-16: `Register` as a FIELD NAME after a
1553
+ // prior field (Winapi.D3D10 shader reflection records). Narrow —
1554
+ // only kRegister; see the root note for why not all callconvs.
1555
+ field('name', delimited1(choice(
1556
+ $.identifier,
1557
+ alias($.kRegister, $.identifier),
1558
+ // `Operator` as a FIELD NAME (JVCL JvXmlDatabase). Mirrors the
1559
+ // root full grammar's fix (2026-07-17).
1560
+ alias($.kOperator, $.identifier),
1561
+ ))),
1531
1562
  ':',
1532
1563
  // Ported from root v1.1.x: field type may be a subrange
1533
1564
  // (`FtrListCount: 0 .. FTRRECMAXCOUNT;`, ORM3 ImportCadFile.pas).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-delphi13-pure",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
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
5
  "main": "bindings/node",
6
6
  "types": "bindings/node",
package/src/grammar.json CHANGED
@@ -3687,8 +3687,22 @@
3687
3687
  "type": "CHOICE",
3688
3688
  "members": [
3689
3689
  {
3690
- "type": "SYMBOL",
3691
- "name": "identifier"
3690
+ "type": "CHOICE",
3691
+ "members": [
3692
+ {
3693
+ "type": "SYMBOL",
3694
+ "name": "identifier"
3695
+ },
3696
+ {
3697
+ "type": "ALIAS",
3698
+ "content": {
3699
+ "type": "SYMBOL",
3700
+ "name": "kAtWord"
3701
+ },
3702
+ "named": true,
3703
+ "value": "identifier"
3704
+ }
3705
+ ]
3692
3706
  },
3693
3707
  {
3694
3708
  "type": "BLANK"
@@ -5287,15 +5301,24 @@
5287
5301
  "type": "CHOICE",
5288
5302
  "members": [
5289
5303
  {
5290
- "type": "SEQ",
5304
+ "type": "CHOICE",
5291
5305
  "members": [
5292
5306
  {
5293
- "type": "SYMBOL",
5294
- "name": "kDeprecated"
5307
+ "type": "SEQ",
5308
+ "members": [
5309
+ {
5310
+ "type": "SYMBOL",
5311
+ "name": "kDeprecated"
5312
+ },
5313
+ {
5314
+ "type": "SYMBOL",
5315
+ "name": "_expr"
5316
+ }
5317
+ ]
5295
5318
  },
5296
5319
  {
5297
5320
  "type": "SYMBOL",
5298
- "name": "_expr"
5321
+ "name": "kPlatform"
5299
5322
  }
5300
5323
  ]
5301
5324
  },
@@ -7111,6 +7134,44 @@
7111
7134
  }
7112
7135
  ]
7113
7136
  },
7137
+ {
7138
+ "type": "SEQ",
7139
+ "members": [
7140
+ {
7141
+ "type": "SYMBOL",
7142
+ "name": "identifier"
7143
+ },
7144
+ {
7145
+ "type": "STRING",
7146
+ "value": "("
7147
+ },
7148
+ {
7149
+ "type": "SEQ",
7150
+ "members": [
7151
+ {
7152
+ "type": "SYMBOL",
7153
+ "name": "identifier"
7154
+ },
7155
+ {
7156
+ "type": "STRING",
7157
+ "value": "("
7158
+ },
7159
+ {
7160
+ "type": "SYMBOL",
7161
+ "name": "identifier"
7162
+ },
7163
+ {
7164
+ "type": "STRING",
7165
+ "value": ")"
7166
+ }
7167
+ ]
7168
+ },
7169
+ {
7170
+ "type": "STRING",
7171
+ "value": ")"
7172
+ }
7173
+ ]
7174
+ },
7114
7175
  {
7115
7176
  "type": "SEQ",
7116
7177
  "members": [
@@ -9557,8 +9618,31 @@
9557
9618
  "type": "SEQ",
9558
9619
  "members": [
9559
9620
  {
9560
- "type": "SYMBOL",
9561
- "name": "identifier"
9621
+ "type": "CHOICE",
9622
+ "members": [
9623
+ {
9624
+ "type": "SYMBOL",
9625
+ "name": "identifier"
9626
+ },
9627
+ {
9628
+ "type": "ALIAS",
9629
+ "content": {
9630
+ "type": "SYMBOL",
9631
+ "name": "kRegister"
9632
+ },
9633
+ "named": true,
9634
+ "value": "identifier"
9635
+ },
9636
+ {
9637
+ "type": "ALIAS",
9638
+ "content": {
9639
+ "type": "SYMBOL",
9640
+ "name": "kOperator"
9641
+ },
9642
+ "named": true,
9643
+ "value": "identifier"
9644
+ }
9645
+ ]
9562
9646
  },
9563
9647
  {
9564
9648
  "type": "STRING",
@@ -9574,8 +9658,31 @@
9574
9658
  ]
9575
9659
  },
9576
9660
  {
9577
- "type": "SYMBOL",
9578
- "name": "identifier"
9661
+ "type": "CHOICE",
9662
+ "members": [
9663
+ {
9664
+ "type": "SYMBOL",
9665
+ "name": "identifier"
9666
+ },
9667
+ {
9668
+ "type": "ALIAS",
9669
+ "content": {
9670
+ "type": "SYMBOL",
9671
+ "name": "kRegister"
9672
+ },
9673
+ "named": true,
9674
+ "value": "identifier"
9675
+ },
9676
+ {
9677
+ "type": "ALIAS",
9678
+ "content": {
9679
+ "type": "SYMBOL",
9680
+ "name": "kOperator"
9681
+ },
9682
+ "named": true,
9683
+ "value": "identifier"
9684
+ }
9685
+ ]
9579
9686
  }
9580
9687
  ]
9581
9688
  }
@@ -12878,6 +12985,13 @@
12878
12985
  "_declProcLenient",
12879
12986
  "_procAttributeNoExt"
12880
12987
  ],
12988
+ [
12989
+ "declFieldNoSemi",
12990
+ "declField"
12991
+ ],
12992
+ [
12993
+ "declField"
12994
+ ],
12881
12995
  [
12882
12996
  "type",
12883
12997
  "declType"
@@ -9344,6 +9344,10 @@
9344
9344
  "type": "kNil",
9345
9345
  "named": true
9346
9346
  },
9347
+ {
9348
+ "type": "kPlatform",
9349
+ "named": true
9350
+ },
9347
9351
  {
9348
9352
  "type": "kTrue",
9349
9353
  "named": true