@willbooster/tree-sitter-php 1.0.3 → 1.0.5
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/README.md
CHANGED
|
@@ -10,8 +10,9 @@ PHP grammars for [tree-sitter](https://github.com/tree-sitter/tree-sitter), fork
|
|
|
10
10
|
[tree-sitter/tree-sitter-php](https://github.com/tree-sitter/tree-sitter-php). We are grateful
|
|
11
11
|
to its authors and contributors. This is not an official release of that project.
|
|
12
12
|
|
|
13
|
-
This fork
|
|
14
|
-
|
|
13
|
+
This fork builds on upstream's version 0.24.2 grammars and queries with support for absolute grouped namespace imports
|
|
14
|
+
and asymmetric visibility in constructor property promotion.
|
|
15
|
+
Its external scanner adapts to the generated array API and fixes incremental heredoc parsing. It generates the parsers with the
|
|
15
16
|
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator. The parsers carry that fork's own ABI
|
|
16
17
|
number, so they load only with its runtime (`willbooster-tree-sitter`, `@willbooster/web-tree-sitter`), version 2.0.0
|
|
17
18
|
or later, and that runtime loads no parser that upstream's generator wrote.
|
package/common/define-grammar.js
CHANGED
|
@@ -290,6 +290,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
290
290
|
|
|
291
291
|
_namespace_use_group: $ => seq(
|
|
292
292
|
field('type', optional($._namespace_use_type)),
|
|
293
|
+
optional('\\'),
|
|
293
294
|
$.namespace_name,
|
|
294
295
|
'\\',
|
|
295
296
|
field('body', $.namespace_use_group),
|
|
@@ -562,9 +563,11 @@ module.exports = function defineGrammar(dialect) {
|
|
|
562
563
|
|
|
563
564
|
property_promotion_parameter: $ => seq(
|
|
564
565
|
optional(field('attributes', $.attribute_list)),
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
repeat1(choice(
|
|
567
|
+
field('visibility', $.visibility_modifier),
|
|
568
|
+
field('readonly', $.readonly_modifier),
|
|
569
|
+
)),
|
|
570
|
+
optional(field('type', $.type)), // Note: callable is not a valid type here, but instead of complicating the parser, we defer this checking to any intelligence using the parser
|
|
568
571
|
field('name', choice($.by_ref, $.variable_name)),
|
|
569
572
|
optional(seq('=', field('default_value', $.expression))),
|
|
570
573
|
optional($.property_hook_list),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-php",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "PHP grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"lefthook": "2.2.1",
|
|
56
56
|
"oxfmt": "0.72.0",
|
|
57
57
|
"oxlint": "1.87.0",
|
|
58
|
-
"oxlint-tsgolint": "7.0.
|
|
58
|
+
"oxlint-tsgolint": "7.0.2004",
|
|
59
59
|
"playwright": "1.64.0",
|
|
60
60
|
"semantic-release": "25.0.9",
|
|
61
61
|
"sort-package-json": "4.0.0",
|
package/php/src/node-types.json
CHANGED
|
@@ -4188,7 +4188,7 @@
|
|
|
4188
4188
|
]
|
|
4189
4189
|
},
|
|
4190
4190
|
"readonly": {
|
|
4191
|
-
"multiple":
|
|
4191
|
+
"multiple": true,
|
|
4192
4192
|
"required": false,
|
|
4193
4193
|
"types": [
|
|
4194
4194
|
{
|
|
@@ -4208,8 +4208,8 @@
|
|
|
4208
4208
|
]
|
|
4209
4209
|
},
|
|
4210
4210
|
"visibility": {
|
|
4211
|
-
"multiple":
|
|
4212
|
-
"required":
|
|
4211
|
+
"multiple": true,
|
|
4212
|
+
"required": false,
|
|
4213
4213
|
"types": [
|
|
4214
4214
|
{
|
|
4215
4215
|
"type": "visibility_modifier",
|
|
@@ -4188,7 +4188,7 @@
|
|
|
4188
4188
|
]
|
|
4189
4189
|
},
|
|
4190
4190
|
"readonly": {
|
|
4191
|
-
"multiple":
|
|
4191
|
+
"multiple": true,
|
|
4192
4192
|
"required": false,
|
|
4193
4193
|
"types": [
|
|
4194
4194
|
{
|
|
@@ -4208,8 +4208,8 @@
|
|
|
4208
4208
|
]
|
|
4209
4209
|
},
|
|
4210
4210
|
"visibility": {
|
|
4211
|
-
"multiple":
|
|
4212
|
-
"required":
|
|
4211
|
+
"multiple": true,
|
|
4212
|
+
"required": false,
|
|
4213
4213
|
"types": [
|
|
4214
4214
|
{
|
|
4215
4215
|
"type": "visibility_modifier",
|
package/tree-sitter-php.wasm
CHANGED
|
Binary file
|
|
Binary file
|