tree-sitter-postgres 19.0.0-beta.4 → 19.0.0-beta.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-postgres",
3
- "version": "19.0.0-beta.4",
3
+ "version": "19.0.0-beta.4.1",
4
4
  "description": "PostgreSQL grammar for tree-sitter, generated from Postgres source",
5
5
  "repository": {
6
6
  "type": "git",
@@ -451,7 +451,7 @@ module.exports = grammar({
451
451
  // ── OPEN cursor ───────────────────────────────────────────────────────────
452
452
  stmt_open: $ => seq(
453
453
  $.kw_open,
454
- $.any_identifier,
454
+ $._cursor_variable,
455
455
  optional(choice(
456
456
  // Unbound cursor: OPEN cur [NO SCROLL | SCROLL] FOR query|EXECUTE expr
457
457
  seq(
@@ -476,7 +476,7 @@ module.exports = grammar({
476
476
  $.kw_fetch,
477
477
  optional($.fetch_direction),
478
478
  optional($.kw_from),
479
- $.any_identifier,
479
+ $._cursor_variable,
480
480
  $.kw_into,
481
481
  $.into_target,
482
482
  ';'
@@ -486,7 +486,7 @@ module.exports = grammar({
486
486
  stmt_move: $ => seq(
487
487
  $.kw_move,
488
488
  optional($.fetch_direction),
489
- $.any_identifier,
489
+ $._cursor_variable,
490
490
  ';'
491
491
  ),
492
492
 
@@ -504,7 +504,11 @@ module.exports = grammar({
504
504
  ),
505
505
 
506
506
  // ── CLOSE ─────────────────────────────────────────────────────────────────
507
- stmt_close: $ => seq($.kw_close, $.any_identifier, ';'),
507
+ stmt_close: $ => seq($.kw_close, $._cursor_variable, ';'),
508
+
509
+ // pl_gram.y cursor_variable is T_DATUM: any variable in scope, including a
510
+ // positional parameter such as $1. The refcursor type check is semantic.
511
+ _cursor_variable: $ => choice($.any_identifier, $.param),
508
512
 
509
513
  // ── NULL statement ────────────────────────────────────────────────────────
510
514
  stmt_null: $ => seq($.kw_null, ';'),
@@ -2225,7 +2225,7 @@
2225
2225
  },
2226
2226
  {
2227
2227
  "type": "SYMBOL",
2228
- "name": "any_identifier"
2228
+ "name": "_cursor_variable"
2229
2229
  },
2230
2230
  {
2231
2231
  "type": "CHOICE",
@@ -2392,7 +2392,7 @@
2392
2392
  },
2393
2393
  {
2394
2394
  "type": "SYMBOL",
2395
- "name": "any_identifier"
2395
+ "name": "_cursor_variable"
2396
2396
  },
2397
2397
  {
2398
2398
  "type": "SYMBOL",
@@ -2429,7 +2429,7 @@
2429
2429
  },
2430
2430
  {
2431
2431
  "type": "SYMBOL",
2432
- "name": "any_identifier"
2432
+ "name": "_cursor_variable"
2433
2433
  },
2434
2434
  {
2435
2435
  "type": "STRING",
@@ -2545,7 +2545,7 @@
2545
2545
  },
2546
2546
  {
2547
2547
  "type": "SYMBOL",
2548
- "name": "any_identifier"
2548
+ "name": "_cursor_variable"
2549
2549
  },
2550
2550
  {
2551
2551
  "type": "STRING",
@@ -2553,6 +2553,19 @@
2553
2553
  }
2554
2554
  ]
2555
2555
  },
2556
+ "_cursor_variable": {
2557
+ "type": "CHOICE",
2558
+ "members": [
2559
+ {
2560
+ "type": "SYMBOL",
2561
+ "name": "any_identifier"
2562
+ },
2563
+ {
2564
+ "type": "SYMBOL",
2565
+ "name": "param"
2566
+ }
2567
+ ]
2568
+ },
2556
2569
  "stmt_null": {
2557
2570
  "type": "SEQ",
2558
2571
  "members": [
@@ -1241,6 +1241,10 @@
1241
1241
  {
1242
1242
  "type": "kw_close",
1243
1243
  "named": true
1244
+ },
1245
+ {
1246
+ "type": "param",
1247
+ "named": true
1244
1248
  }
1245
1249
  ]
1246
1250
  }
@@ -1376,6 +1380,10 @@
1376
1380
  {
1377
1381
  "type": "kw_into",
1378
1382
  "named": true
1383
+ },
1384
+ {
1385
+ "type": "param",
1386
+ "named": true
1379
1387
  }
1380
1388
  ]
1381
1389
  }
@@ -1590,6 +1598,10 @@
1590
1598
  {
1591
1599
  "type": "kw_move",
1592
1600
  "named": true
1601
+ },
1602
+ {
1603
+ "type": "param",
1604
+ "named": true
1593
1605
  }
1594
1606
  ]
1595
1607
  }
@@ -1641,6 +1653,10 @@
1641
1653
  "type": "opt_scrollable",
1642
1654
  "named": true
1643
1655
  },
1656
+ {
1657
+ "type": "param",
1658
+ "named": true
1659
+ },
1644
1660
  {
1645
1661
  "type": "sql_expression",
1646
1662
  "named": true