@willbooster/tree-sitter-php 1.0.5 → 1.2.0
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 +3 -1
- package/common/define-grammar.js +75 -59
- package/package.json +1 -2
- package/php/src/node-types.json +26 -27
- package/php_only/src/node-types.json +26 -27
- package/tree-sitter-php.wasm +0 -0
- package/tree-sitter-php_only.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# @willbooster/tree-sitter-php
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@willbooster/tree-sitter-php)
|
|
4
|
+
[](https://www.npmjs.com/package/@willbooster/tree-sitter-php)
|
|
3
5
|
[](https://github.com/WillBooster/tree-sitter-php/actions/workflows/test.yml)
|
|
4
6
|
[](https://github.com/WillBooster/tree-sitter-php/actions/workflows/test-rust.yml)
|
|
5
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
6
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
7
9
|
[](https://crates.io/crates/willbooster-tree-sitter-php)
|
|
8
10
|
|
|
9
11
|
PHP grammars for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
package/common/define-grammar.js
CHANGED
|
@@ -57,18 +57,25 @@ const BASE_RESERVED_KEYWORD_SET = [
|
|
|
57
57
|
'instanceof', 'insteadof', 'interface', 'match', 'namespace', 'new',
|
|
58
58
|
'or', 'print', 'private', 'protected', 'public', 'readonly',
|
|
59
59
|
'require', 'require_once', 'return', 'static', 'switch', 'throw',
|
|
60
|
-
'trait', 'try', 'use', 'var', 'while', 'xor', 'yield from', 'yield',
|
|
60
|
+
'trait', 'try', 'unset', 'use', 'var', 'while', 'xor', 'yield from', 'yield',
|
|
61
61
|
].map(r => keyword(r, false));
|
|
62
62
|
|
|
63
|
+
const IDENTIFIER_TYPE_KEYWORDS = ['bool', 'float', 'int', 'object', 'string'].map(word => keyword(word, false));
|
|
64
|
+
|
|
63
65
|
/**
|
|
64
66
|
* Other keywords that are reserved in PHP, and cannot be used as class names.
|
|
65
67
|
*
|
|
66
68
|
* @see https://www.php.net/manual/en/reserved.other-reserved-words.php
|
|
67
69
|
*/
|
|
68
70
|
const OTHER_RESERVED_KEYWORD_SET = [
|
|
69
|
-
|
|
70
|
-
'
|
|
71
|
-
]
|
|
71
|
+
...IDENTIFIER_TYPE_KEYWORDS,
|
|
72
|
+
...['false', 'iterable', 'mixed', 'never', 'null', 'true', 'void'].map(word => keyword(word, false)),
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
const CAST_TYPES = [
|
|
76
|
+
'array', 'binary', 'bool', 'boolean', 'double', 'float',
|
|
77
|
+
'int', 'integer', 'object', 'real', 'string', 'unset',
|
|
78
|
+
];
|
|
72
79
|
|
|
73
80
|
module.exports = function defineGrammar(dialect) {
|
|
74
81
|
if (dialect !== 'php' && dialect !== 'php_only') {
|
|
@@ -90,6 +97,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
90
97
|
|
|
91
98
|
[$.namespace_name],
|
|
92
99
|
[$.heredoc_body],
|
|
100
|
+
[$.parenthesized_expression, $.argument],
|
|
93
101
|
],
|
|
94
102
|
|
|
95
103
|
externals: $ => [
|
|
@@ -122,6 +130,8 @@ module.exports = function defineGrammar(dialect) {
|
|
|
122
130
|
},
|
|
123
131
|
|
|
124
132
|
inline: $ => [
|
|
133
|
+
$._identifier,
|
|
134
|
+
$._unreserved_identifier,
|
|
125
135
|
$._variable,
|
|
126
136
|
$._namespace_use_type,
|
|
127
137
|
],
|
|
@@ -256,15 +266,15 @@ module.exports = function defineGrammar(dialect) {
|
|
|
256
266
|
|
|
257
267
|
namespace_use_clause: $ => seq(
|
|
258
268
|
field('type', optional($._namespace_use_type)),
|
|
259
|
-
choice($.
|
|
260
|
-
optional(seq(keyword('as'), field('alias', $.
|
|
269
|
+
choice($._identifier, $.qualified_name),
|
|
270
|
+
optional(seq(keyword('as'), field('alias', $._identifier))),
|
|
261
271
|
),
|
|
262
272
|
|
|
263
273
|
_namespace_use_type: _ => choice(keyword('function'), keyword('const')),
|
|
264
274
|
|
|
265
275
|
qualified_name: $ => seq(
|
|
266
276
|
field('prefix', seq(optional('\\'), optional($.namespace_name), '\\')),
|
|
267
|
-
|
|
277
|
+
$._unreserved_identifier,
|
|
268
278
|
),
|
|
269
279
|
|
|
270
280
|
relative_name: $ => seq(
|
|
@@ -273,19 +283,20 @@ module.exports = function defineGrammar(dialect) {
|
|
|
273
283
|
optional(seq('\\', $.namespace_name)),
|
|
274
284
|
'\\',
|
|
275
285
|
)),
|
|
276
|
-
|
|
286
|
+
$._unreserved_identifier,
|
|
277
287
|
),
|
|
278
288
|
|
|
279
289
|
_name: $ => choice(
|
|
280
290
|
alias(keyword('static', false), $.name),
|
|
291
|
+
alias(choice(...IDENTIFIER_TYPE_KEYWORDS), $.name),
|
|
281
292
|
reserved('classes', $.name),
|
|
282
293
|
$.qualified_name,
|
|
283
294
|
$.relative_name,
|
|
284
295
|
),
|
|
285
296
|
|
|
286
297
|
namespace_name: $ => seq(
|
|
287
|
-
|
|
288
|
-
repeat(seq('\\',
|
|
298
|
+
$._unreserved_identifier,
|
|
299
|
+
repeat(seq('\\', $._unreserved_identifier)),
|
|
289
300
|
),
|
|
290
301
|
|
|
291
302
|
_namespace_use_group: $ => seq(
|
|
@@ -339,7 +350,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
339
350
|
enum_case: $ => seq(
|
|
340
351
|
optional(field('attributes', $.attribute_list)),
|
|
341
352
|
keyword('case'),
|
|
342
|
-
field('name',
|
|
353
|
+
field('name', $._unreserved_identifier),
|
|
343
354
|
optional(seq('=', field('value', $.expression))),
|
|
344
355
|
$._semicolon,
|
|
345
356
|
),
|
|
@@ -422,7 +433,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
422
433
|
optional(field('attributes', $.attribute_list)),
|
|
423
434
|
optional(field('final', $.final_modifier)),
|
|
424
435
|
optional(field('reference_modifier', $.reference_modifier)),
|
|
425
|
-
$.
|
|
436
|
+
$._identifier,
|
|
426
437
|
optional(field('parameters', $.formal_parameters)),
|
|
427
438
|
$._property_hook_body,
|
|
428
439
|
),
|
|
@@ -438,7 +449,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
438
449
|
repeat($._modifier),
|
|
439
450
|
keyword('function'),
|
|
440
451
|
optional($.reference_modifier),
|
|
441
|
-
field('name',
|
|
452
|
+
field('name', $._unreserved_identifier),
|
|
442
453
|
field('parameters', $.formal_parameters),
|
|
443
454
|
optional($._return_type),
|
|
444
455
|
choice(
|
|
@@ -471,20 +482,20 @@ module.exports = function defineGrammar(dialect) {
|
|
|
471
482
|
use_instead_of_clause: $ => prec.left(seq(
|
|
472
483
|
$.class_constant_access_expression,
|
|
473
484
|
keyword('insteadof'),
|
|
474
|
-
$.
|
|
485
|
+
$._identifier,
|
|
475
486
|
)),
|
|
476
487
|
|
|
477
488
|
use_as_clause: $ => seq(
|
|
478
|
-
choice($.class_constant_access_expression, $.
|
|
489
|
+
choice($.class_constant_access_expression, $._unreserved_identifier),
|
|
479
490
|
keyword('as'),
|
|
480
491
|
choice(
|
|
481
492
|
seq(
|
|
482
493
|
optional($.visibility_modifier),
|
|
483
|
-
$.
|
|
494
|
+
$._unreserved_identifier,
|
|
484
495
|
),
|
|
485
496
|
seq(
|
|
486
497
|
$.visibility_modifier,
|
|
487
|
-
optional($.
|
|
498
|
+
optional($._unreserved_identifier),
|
|
488
499
|
),
|
|
489
500
|
),
|
|
490
501
|
),
|
|
@@ -497,7 +508,10 @@ module.exports = function defineGrammar(dialect) {
|
|
|
497
508
|
),
|
|
498
509
|
optional(seq(
|
|
499
510
|
token.immediate('('),
|
|
500
|
-
|
|
511
|
+
choice(
|
|
512
|
+
alias($.name, $.operation),
|
|
513
|
+
alias(choice(...IDENTIFIER_TYPE_KEYWORDS), $.operation),
|
|
514
|
+
),
|
|
501
515
|
token.immediate(')'),
|
|
502
516
|
)),
|
|
503
517
|
),
|
|
@@ -506,7 +520,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
506
520
|
optional(field('attributes', $.attribute_list)),
|
|
507
521
|
keyword('function'),
|
|
508
522
|
optional($.reference_modifier),
|
|
509
|
-
field('name', $.
|
|
523
|
+
field('name', $._identifier),
|
|
510
524
|
field('parameters', $.formal_parameters),
|
|
511
525
|
optional($._return_type),
|
|
512
526
|
field('body', $.compound_statement),
|
|
@@ -628,40 +642,23 @@ module.exports = function defineGrammar(dialect) {
|
|
|
628
642
|
))),
|
|
629
643
|
|
|
630
644
|
primitive_type: _ => choice(
|
|
645
|
+
...IDENTIFIER_TYPE_KEYWORDS,
|
|
631
646
|
'array',
|
|
632
|
-
'bool',
|
|
633
647
|
keyword('callable', false), // not legal in property types
|
|
634
648
|
keyword('false', false),
|
|
635
|
-
'float',
|
|
636
|
-
'int',
|
|
637
649
|
keyword('iterable', false),
|
|
638
650
|
keyword('mixed', false),
|
|
639
651
|
'null',
|
|
640
|
-
'object',
|
|
641
|
-
'string',
|
|
642
652
|
keyword('true', false),
|
|
643
653
|
keyword('void', false),
|
|
644
654
|
),
|
|
645
655
|
|
|
646
|
-
cast_type: _ => choice(
|
|
647
|
-
keyword('array', false),
|
|
648
|
-
keyword('binary', false),
|
|
649
|
-
keyword('bool', false),
|
|
650
|
-
keyword('boolean', false),
|
|
651
|
-
keyword('double', false),
|
|
652
|
-
keyword('float', false),
|
|
653
|
-
keyword('int', false),
|
|
654
|
-
keyword('integer', false),
|
|
655
|
-
keyword('object', false),
|
|
656
|
-
keyword('real', false),
|
|
657
|
-
keyword('string', false),
|
|
658
|
-
keyword('unset', false),
|
|
659
|
-
),
|
|
656
|
+
cast_type: _ => token(seq('(', /[ \t]*/, choice(...CAST_TYPES.map(type => new RegExp(type, 'i'))), /[ \t]*/, ')')),
|
|
660
657
|
|
|
661
658
|
_return_type: $ => seq(':', field('return_type', choice($.type, $.bottom_type))),
|
|
662
659
|
|
|
663
|
-
_const_element: $ => seq($.
|
|
664
|
-
_class_const_element: $ => seq(
|
|
660
|
+
_const_element: $ => seq($._identifier, '=', $.expression),
|
|
661
|
+
_class_const_element: $ => seq($._unreserved_identifier, '=', $.expression),
|
|
665
662
|
|
|
666
663
|
echo_statement: $ => seq(keyword('echo'), $._expressions, $._semicolon),
|
|
667
664
|
|
|
@@ -672,7 +669,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
672
669
|
),
|
|
673
670
|
|
|
674
671
|
unset_statement: $ => seq(
|
|
675
|
-
'unset',
|
|
672
|
+
keyword('unset'),
|
|
676
673
|
'(',
|
|
677
674
|
commaSep1($._variable),
|
|
678
675
|
optional(','),
|
|
@@ -728,7 +725,12 @@ module.exports = function defineGrammar(dialect) {
|
|
|
728
725
|
field('body', $.compound_statement),
|
|
729
726
|
),
|
|
730
727
|
|
|
731
|
-
type_list: $ => pipeSep1(
|
|
728
|
+
type_list: $ => pipeSep1(choice(
|
|
729
|
+
$.named_type,
|
|
730
|
+
alias($._catch_type_keyword, $.named_type),
|
|
731
|
+
)),
|
|
732
|
+
|
|
733
|
+
_catch_type_keyword: $ => alias(choice(...IDENTIFIER_TYPE_KEYWORDS), $.name),
|
|
732
734
|
|
|
733
735
|
finally_clause: $ => seq(
|
|
734
736
|
keyword('finally'),
|
|
@@ -736,7 +738,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
736
738
|
),
|
|
737
739
|
|
|
738
740
|
goto_statement: $ => seq(
|
|
739
|
-
keyword('goto'), $.
|
|
741
|
+
keyword('goto'), $._identifier, $._semicolon,
|
|
740
742
|
),
|
|
741
743
|
|
|
742
744
|
continue_statement: $ => seq(
|
|
@@ -964,7 +966,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
964
966
|
|
|
965
967
|
compound_statement: $ => seq('{', repeat($.statement), '}'),
|
|
966
968
|
|
|
967
|
-
named_label_statement: $ => seq($.
|
|
969
|
+
named_label_statement: $ => seq($._identifier, ':'),
|
|
968
970
|
|
|
969
971
|
expression_statement: $ => seq($.expression, $._semicolon),
|
|
970
972
|
|
|
@@ -998,7 +1000,13 @@ module.exports = function defineGrammar(dialect) {
|
|
|
998
1000
|
|
|
999
1001
|
error_suppression_expression: $ => prec(PREC.INC, seq('@', $.expression)),
|
|
1000
1002
|
|
|
1001
|
-
clone_expression: $ => seq(
|
|
1003
|
+
clone_expression: $ => seq(
|
|
1004
|
+
keyword('clone'),
|
|
1005
|
+
choice(
|
|
1006
|
+
$.primary_expression,
|
|
1007
|
+
field('arguments', $.arguments),
|
|
1008
|
+
),
|
|
1009
|
+
),
|
|
1002
1010
|
|
|
1003
1011
|
primary_expression: $ => choice(
|
|
1004
1012
|
$._variable,
|
|
@@ -1006,7 +1014,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1006
1014
|
$.class_constant_access_expression,
|
|
1007
1015
|
$.qualified_name,
|
|
1008
1016
|
$.relative_name,
|
|
1009
|
-
$.
|
|
1017
|
+
$._identifier,
|
|
1010
1018
|
$.array_creation_expression,
|
|
1011
1019
|
$.print_intrinsic,
|
|
1012
1020
|
$.anonymous_function,
|
|
@@ -1024,7 +1032,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1024
1032
|
$._scope_resolution_qualifier,
|
|
1025
1033
|
'::',
|
|
1026
1034
|
choice(
|
|
1027
|
-
|
|
1035
|
+
$._unreserved_identifier,
|
|
1028
1036
|
seq('{', alias($.expression, $.name), '}'),
|
|
1029
1037
|
),
|
|
1030
1038
|
),
|
|
@@ -1077,9 +1085,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1077
1085
|
},
|
|
1078
1086
|
|
|
1079
1087
|
cast_expression: $ => prec(PREC.CAST, seq(
|
|
1080
|
-
'(',
|
|
1081
1088
|
field('type', $.cast_type),
|
|
1082
|
-
')',
|
|
1083
1089
|
field('value', choice(
|
|
1084
1090
|
$._unary_expression,
|
|
1085
1091
|
$.include_expression,
|
|
@@ -1089,7 +1095,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1089
1095
|
)),
|
|
1090
1096
|
|
|
1091
1097
|
cast_variable: $ => prec(PREC.CAST, seq(
|
|
1092
|
-
|
|
1098
|
+
field('type', $.cast_type),
|
|
1093
1099
|
field('value', $._variable),
|
|
1094
1100
|
)),
|
|
1095
1101
|
|
|
@@ -1265,12 +1271,11 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1265
1271
|
|
|
1266
1272
|
variadic_placeholder: _ => '...',
|
|
1267
1273
|
|
|
1274
|
+
argument_placeholder: _ => '?',
|
|
1275
|
+
|
|
1268
1276
|
arguments: $ => seq(
|
|
1269
1277
|
'(',
|
|
1270
|
-
optional(choice(
|
|
1271
|
-
seq(commaSep1($.argument), optional(',')),
|
|
1272
|
-
$.variadic_placeholder,
|
|
1273
|
-
)),
|
|
1278
|
+
optional(seq(commaSep1(choice($.argument, $.variadic_placeholder)), optional(','))),
|
|
1274
1279
|
')',
|
|
1275
1280
|
),
|
|
1276
1281
|
|
|
@@ -1281,13 +1286,14 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1281
1286
|
alias($.relative_scope, $.name),
|
|
1282
1287
|
$.variadic_unpacking,
|
|
1283
1288
|
$.expression,
|
|
1289
|
+
$.argument_placeholder,
|
|
1284
1290
|
),
|
|
1285
1291
|
),
|
|
1286
1292
|
|
|
1287
1293
|
_argument_name: $ => seq(
|
|
1288
1294
|
field('name', alias(
|
|
1289
1295
|
choice(
|
|
1290
|
-
|
|
1296
|
+
$._unreserved_identifier,
|
|
1291
1297
|
keyword('array', false),
|
|
1292
1298
|
keyword('fn', false),
|
|
1293
1299
|
keyword('function', false),
|
|
@@ -1322,7 +1328,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1322
1328
|
variadic_unpacking: $ => seq('...', $.expression),
|
|
1323
1329
|
|
|
1324
1330
|
_member_name: $ => choice(
|
|
1325
|
-
field('name', choice(
|
|
1331
|
+
field('name', choice($._unreserved_identifier, $._simple_variable)),
|
|
1326
1332
|
seq('{', field('name', $.expression), '}'),
|
|
1327
1333
|
),
|
|
1328
1334
|
|
|
@@ -1374,7 +1380,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1374
1380
|
_simple_string_member_access_expression: $ => prec(PREC.MEMBER, seq(
|
|
1375
1381
|
field('object', $.variable_name),
|
|
1376
1382
|
'->',
|
|
1377
|
-
field('name', $.
|
|
1383
|
+
field('name', $._unreserved_identifier),
|
|
1378
1384
|
)),
|
|
1379
1385
|
|
|
1380
1386
|
_simple_string_subscript_unary_expression: $ => prec.left(seq('-', $.integer)),
|
|
@@ -1382,7 +1388,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1382
1388
|
_simple_string_array_access_argument: $ => choice(
|
|
1383
1389
|
$.integer,
|
|
1384
1390
|
alias($._simple_string_subscript_unary_expression, $.unary_op_expression),
|
|
1385
|
-
$.
|
|
1391
|
+
$._unreserved_identifier,
|
|
1386
1392
|
$.variable_name,
|
|
1387
1393
|
),
|
|
1388
1394
|
|
|
@@ -1554,7 +1560,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1554
1560
|
$.scoped_call_expression,
|
|
1555
1561
|
),
|
|
1556
1562
|
|
|
1557
|
-
variable_name: $ => seq('$',
|
|
1563
|
+
variable_name: $ => seq('$', $._unreserved_identifier),
|
|
1558
1564
|
|
|
1559
1565
|
by_ref: $ => seq('&', $._variable),
|
|
1560
1566
|
|
|
@@ -1628,6 +1634,16 @@ module.exports = function defineGrammar(dialect) {
|
|
|
1628
1634
|
require_expression: $ => seq(keyword('require'), $.expression),
|
|
1629
1635
|
require_once_expression: $ => seq(keyword('require_once'), $.expression),
|
|
1630
1636
|
|
|
1637
|
+
_unreserved_identifier: $ => choice(
|
|
1638
|
+
reserved('nothing', $.name),
|
|
1639
|
+
alias(choice(...IDENTIFIER_TYPE_KEYWORDS, keyword('unset', false)), $.name),
|
|
1640
|
+
),
|
|
1641
|
+
|
|
1642
|
+
_identifier: $ => choice(
|
|
1643
|
+
$.name,
|
|
1644
|
+
alias(choice(...IDENTIFIER_TYPE_KEYWORDS), $.name),
|
|
1645
|
+
),
|
|
1646
|
+
|
|
1631
1647
|
// Note that PHP officially only supports the following character regex
|
|
1632
1648
|
// for identifiers: ^[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*$
|
|
1633
1649
|
// However, there is a "bug" in how PHP parses multi-byte characters that allows
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-php",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "PHP grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
"playwright": "1.64.0",
|
|
60
60
|
"semantic-release": "25.0.9",
|
|
61
61
|
"sort-package-json": "4.0.0",
|
|
62
|
-
"typescript": "7.0.2",
|
|
63
62
|
"vitest": "5.0.3",
|
|
64
63
|
"wrangler": "4.149.0"
|
|
65
64
|
},
|
package/php/src/node-types.json
CHANGED
|
@@ -566,6 +566,10 @@
|
|
|
566
566
|
"multiple": false,
|
|
567
567
|
"required": true,
|
|
568
568
|
"types": [
|
|
569
|
+
{
|
|
570
|
+
"type": "argument_placeholder",
|
|
571
|
+
"named": true
|
|
572
|
+
},
|
|
569
573
|
{
|
|
570
574
|
"type": "expression",
|
|
571
575
|
"named": true
|
|
@@ -581,6 +585,11 @@
|
|
|
581
585
|
]
|
|
582
586
|
}
|
|
583
587
|
},
|
|
588
|
+
{
|
|
589
|
+
"type": "argument_placeholder",
|
|
590
|
+
"named": true,
|
|
591
|
+
"fields": {}
|
|
592
|
+
},
|
|
584
593
|
{
|
|
585
594
|
"type": "arguments",
|
|
586
595
|
"named": true,
|
|
@@ -1328,11 +1337,6 @@
|
|
|
1328
1337
|
}
|
|
1329
1338
|
}
|
|
1330
1339
|
},
|
|
1331
|
-
{
|
|
1332
|
-
"type": "cast_type",
|
|
1333
|
-
"named": true,
|
|
1334
|
-
"fields": {}
|
|
1335
|
-
},
|
|
1336
1340
|
{
|
|
1337
1341
|
"type": "catch_clause",
|
|
1338
1342
|
"named": true,
|
|
@@ -1572,10 +1576,21 @@
|
|
|
1572
1576
|
{
|
|
1573
1577
|
"type": "clone_expression",
|
|
1574
1578
|
"named": true,
|
|
1575
|
-
"fields": {
|
|
1579
|
+
"fields": {
|
|
1580
|
+
"arguments": {
|
|
1581
|
+
"multiple": false,
|
|
1582
|
+
"required": false,
|
|
1583
|
+
"types": [
|
|
1584
|
+
{
|
|
1585
|
+
"type": "arguments",
|
|
1586
|
+
"named": true
|
|
1587
|
+
}
|
|
1588
|
+
]
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1576
1591
|
"children": {
|
|
1577
1592
|
"multiple": false,
|
|
1578
|
-
"required":
|
|
1593
|
+
"required": false,
|
|
1579
1594
|
"types": [
|
|
1580
1595
|
{
|
|
1581
1596
|
"type": "primary_expression",
|
|
@@ -5804,10 +5819,6 @@
|
|
|
5804
5819
|
"type": "as",
|
|
5805
5820
|
"named": false
|
|
5806
5821
|
},
|
|
5807
|
-
{
|
|
5808
|
-
"type": "bool",
|
|
5809
|
-
"named": false
|
|
5810
|
-
},
|
|
5811
5822
|
{
|
|
5812
5823
|
"type": "bottom_type",
|
|
5813
5824
|
"named": true
|
|
@@ -5820,6 +5831,10 @@
|
|
|
5820
5831
|
"type": "case",
|
|
5821
5832
|
"named": false
|
|
5822
5833
|
},
|
|
5834
|
+
{
|
|
5835
|
+
"type": "cast_type",
|
|
5836
|
+
"named": true
|
|
5837
|
+
},
|
|
5823
5838
|
{
|
|
5824
5839
|
"type": "catch",
|
|
5825
5840
|
"named": false
|
|
@@ -5921,10 +5936,6 @@
|
|
|
5921
5936
|
"type": "finally",
|
|
5922
5937
|
"named": false
|
|
5923
5938
|
},
|
|
5924
|
-
{
|
|
5925
|
-
"type": "float",
|
|
5926
|
-
"named": false
|
|
5927
|
-
},
|
|
5928
5939
|
{
|
|
5929
5940
|
"type": "float",
|
|
5930
5941
|
"named": true
|
|
@@ -5985,10 +5996,6 @@
|
|
|
5985
5996
|
"type": "insteadof",
|
|
5986
5997
|
"named": false
|
|
5987
5998
|
},
|
|
5988
|
-
{
|
|
5989
|
-
"type": "int",
|
|
5990
|
-
"named": false
|
|
5991
|
-
},
|
|
5992
5999
|
{
|
|
5993
6000
|
"type": "integer",
|
|
5994
6001
|
"named": true
|
|
@@ -6021,10 +6028,6 @@
|
|
|
6021
6028
|
"type": "null",
|
|
6022
6029
|
"named": false
|
|
6023
6030
|
},
|
|
6024
|
-
{
|
|
6025
|
-
"type": "object",
|
|
6026
|
-
"named": false
|
|
6027
|
-
},
|
|
6028
6031
|
{
|
|
6029
6032
|
"type": "operation",
|
|
6030
6033
|
"named": true
|
|
@@ -6089,10 +6092,6 @@
|
|
|
6089
6092
|
"type": "strict_types",
|
|
6090
6093
|
"named": false
|
|
6091
6094
|
},
|
|
6092
|
-
{
|
|
6093
|
-
"type": "string",
|
|
6094
|
-
"named": false
|
|
6095
|
-
},
|
|
6096
6095
|
{
|
|
6097
6096
|
"type": "switch",
|
|
6098
6097
|
"named": false
|
|
@@ -566,6 +566,10 @@
|
|
|
566
566
|
"multiple": false,
|
|
567
567
|
"required": true,
|
|
568
568
|
"types": [
|
|
569
|
+
{
|
|
570
|
+
"type": "argument_placeholder",
|
|
571
|
+
"named": true
|
|
572
|
+
},
|
|
569
573
|
{
|
|
570
574
|
"type": "expression",
|
|
571
575
|
"named": true
|
|
@@ -581,6 +585,11 @@
|
|
|
581
585
|
]
|
|
582
586
|
}
|
|
583
587
|
},
|
|
588
|
+
{
|
|
589
|
+
"type": "argument_placeholder",
|
|
590
|
+
"named": true,
|
|
591
|
+
"fields": {}
|
|
592
|
+
},
|
|
584
593
|
{
|
|
585
594
|
"type": "arguments",
|
|
586
595
|
"named": true,
|
|
@@ -1328,11 +1337,6 @@
|
|
|
1328
1337
|
}
|
|
1329
1338
|
}
|
|
1330
1339
|
},
|
|
1331
|
-
{
|
|
1332
|
-
"type": "cast_type",
|
|
1333
|
-
"named": true,
|
|
1334
|
-
"fields": {}
|
|
1335
|
-
},
|
|
1336
1340
|
{
|
|
1337
1341
|
"type": "catch_clause",
|
|
1338
1342
|
"named": true,
|
|
@@ -1572,10 +1576,21 @@
|
|
|
1572
1576
|
{
|
|
1573
1577
|
"type": "clone_expression",
|
|
1574
1578
|
"named": true,
|
|
1575
|
-
"fields": {
|
|
1579
|
+
"fields": {
|
|
1580
|
+
"arguments": {
|
|
1581
|
+
"multiple": false,
|
|
1582
|
+
"required": false,
|
|
1583
|
+
"types": [
|
|
1584
|
+
{
|
|
1585
|
+
"type": "arguments",
|
|
1586
|
+
"named": true
|
|
1587
|
+
}
|
|
1588
|
+
]
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1576
1591
|
"children": {
|
|
1577
1592
|
"multiple": false,
|
|
1578
|
-
"required":
|
|
1593
|
+
"required": false,
|
|
1579
1594
|
"types": [
|
|
1580
1595
|
{
|
|
1581
1596
|
"type": "primary_expression",
|
|
@@ -5775,10 +5790,6 @@
|
|
|
5775
5790
|
"type": "as",
|
|
5776
5791
|
"named": false
|
|
5777
5792
|
},
|
|
5778
|
-
{
|
|
5779
|
-
"type": "bool",
|
|
5780
|
-
"named": false
|
|
5781
|
-
},
|
|
5782
5793
|
{
|
|
5783
5794
|
"type": "bottom_type",
|
|
5784
5795
|
"named": true
|
|
@@ -5791,6 +5802,10 @@
|
|
|
5791
5802
|
"type": "case",
|
|
5792
5803
|
"named": false
|
|
5793
5804
|
},
|
|
5805
|
+
{
|
|
5806
|
+
"type": "cast_type",
|
|
5807
|
+
"named": true
|
|
5808
|
+
},
|
|
5794
5809
|
{
|
|
5795
5810
|
"type": "catch",
|
|
5796
5811
|
"named": false
|
|
@@ -5892,10 +5907,6 @@
|
|
|
5892
5907
|
"type": "finally",
|
|
5893
5908
|
"named": false
|
|
5894
5909
|
},
|
|
5895
|
-
{
|
|
5896
|
-
"type": "float",
|
|
5897
|
-
"named": false
|
|
5898
|
-
},
|
|
5899
5910
|
{
|
|
5900
5911
|
"type": "float",
|
|
5901
5912
|
"named": true
|
|
@@ -5956,10 +5967,6 @@
|
|
|
5956
5967
|
"type": "insteadof",
|
|
5957
5968
|
"named": false
|
|
5958
5969
|
},
|
|
5959
|
-
{
|
|
5960
|
-
"type": "int",
|
|
5961
|
-
"named": false
|
|
5962
|
-
},
|
|
5963
5970
|
{
|
|
5964
5971
|
"type": "integer",
|
|
5965
5972
|
"named": true
|
|
@@ -5992,10 +5999,6 @@
|
|
|
5992
5999
|
"type": "null",
|
|
5993
6000
|
"named": false
|
|
5994
6001
|
},
|
|
5995
|
-
{
|
|
5996
|
-
"type": "object",
|
|
5997
|
-
"named": false
|
|
5998
|
-
},
|
|
5999
6002
|
{
|
|
6000
6003
|
"type": "operation",
|
|
6001
6004
|
"named": true
|
|
@@ -6060,10 +6063,6 @@
|
|
|
6060
6063
|
"type": "strict_types",
|
|
6061
6064
|
"named": false
|
|
6062
6065
|
},
|
|
6063
|
-
{
|
|
6064
|
-
"type": "string",
|
|
6065
|
-
"named": false
|
|
6066
|
-
},
|
|
6067
6066
|
{
|
|
6068
6067
|
"type": "switch",
|
|
6069
6068
|
"named": false
|
package/tree-sitter-php.wasm
CHANGED
|
Binary file
|
|
Binary file
|