summaryrefslogtreecommitdiff
path: root/vendor/nikic/php-parser/grammar
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-07-12 22:26:21 +0300
committerAndrew Dolgov <[email protected]>2022-07-12 22:26:21 +0300
commit80d3db1dcf8fe9ca66d4e3f2e2116d3bc39ae2b4 (patch)
tree04b33bfb9c9368c4a31e287153abec690b9014e0 /vendor/nikic/php-parser/grammar
parent4b6161892000cb2b8392dce92a9cf2cabdf2d20e (diff)
upgrade idiorm to php8.1-patched version (aaronpk/idiorm)
Diffstat (limited to 'vendor/nikic/php-parser/grammar')
-rw-r--r--vendor/nikic/php-parser/grammar/php5.y10
-rw-r--r--vendor/nikic/php-parser/grammar/php7.y20
-rw-r--r--vendor/nikic/php-parser/grammar/phpyLang.php8
3 files changed, 17 insertions, 21 deletions
diff --git a/vendor/nikic/php-parser/grammar/php5.y b/vendor/nikic/php-parser/grammar/php5.y
index f9e7e7dd1..a62e9a310 100644
--- a/vendor/nikic/php-parser/grammar/php5.y
+++ b/vendor/nikic/php-parser/grammar/php5.y
@@ -689,9 +689,7 @@ array_expr:
scalar_dereference:
array_expr '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; }
- | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']'
- { $attrs = attributes(); $attrs['kind'] = strKind($1);
- $$ = Expr\ArrayDimFetch[new Scalar\String_(Scalar\String_::parse($1), $attrs), $3]; }
+ | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[Scalar\String_::fromString($1, attributes()), $3]; }
| constant '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; }
| scalar_dereference '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; }
/* alternative array syntax missing intentionally */
@@ -793,10 +791,8 @@ ctor_arguments:
common_scalar:
T_LNUMBER { $$ = $this->parseLNumber($1, attributes(), true); }
- | T_DNUMBER { $$ = Scalar\DNumber[Scalar\DNumber::parse($1)]; }
- | T_CONSTANT_ENCAPSED_STRING
- { $attrs = attributes(); $attrs['kind'] = strKind($1);
- $$ = new Scalar\String_(Scalar\String_::parse($1, false), $attrs); }
+ | T_DNUMBER { $$ = Scalar\DNumber::fromString($1, attributes()); }
+ | T_CONSTANT_ENCAPSED_STRING { $$ = Scalar\String_::fromString($1, attributes(), false); }
| T_LINE { $$ = Scalar\MagicConst\Line[]; }
| T_FILE { $$ = Scalar\MagicConst\File[]; }
| T_DIR { $$ = Scalar\MagicConst\Dir[]; }
diff --git a/vendor/nikic/php-parser/grammar/php7.y b/vendor/nikic/php-parser/grammar/php7.y
index eac68d095..087bc7392 100644
--- a/vendor/nikic/php-parser/grammar/php7.y
+++ b/vendor/nikic/php-parser/grammar/php7.y
@@ -382,8 +382,18 @@ enum_case_expr:
class_entry_type:
T_CLASS { $$ = 0; }
- | T_ABSTRACT T_CLASS { $$ = Stmt\Class_::MODIFIER_ABSTRACT; }
- | T_FINAL T_CLASS { $$ = Stmt\Class_::MODIFIER_FINAL; }
+ | class_modifiers T_CLASS { $$ = $1; }
+;
+
+class_modifiers:
+ class_modifier { $$ = $1; }
+ | class_modifiers class_modifier { $this->checkClassModifier($1, $2, #2); $$ = $1 | $2; }
+;
+
+class_modifier:
+ T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; }
+ | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; }
+ | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; }
;
extends_from:
@@ -1014,9 +1024,7 @@ dereferencable_scalar:
{ $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_LONG;
$$ = new Expr\Array_($3, $attrs); }
| array_short_syntax { $$ = $1; }
- | T_CONSTANT_ENCAPSED_STRING
- { $attrs = attributes(); $attrs['kind'] = strKind($1);
- $$ = new Scalar\String_(Scalar\String_::parse($1), $attrs); }
+ | T_CONSTANT_ENCAPSED_STRING { $$ = Scalar\String_::fromString($1, attributes()); }
| '"' encaps_list '"'
{ $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED;
parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); }
@@ -1024,7 +1032,7 @@ dereferencable_scalar:
scalar:
T_LNUMBER { $$ = $this->parseLNumber($1, attributes()); }
- | T_DNUMBER { $$ = Scalar\DNumber[Scalar\DNumber::parse($1)]; }
+ | T_DNUMBER { $$ = Scalar\DNumber::fromString($1, attributes()); }
| dereferencable_scalar { $$ = $1; }
| constant { $$ = $1; }
| class_constant { $$ = $1; }
diff --git a/vendor/nikic/php-parser/grammar/phpyLang.php b/vendor/nikic/php-parser/grammar/phpyLang.php
index 1a9808dcf..663c2a144 100644
--- a/vendor/nikic/php-parser/grammar/phpyLang.php
+++ b/vendor/nikic/php-parser/grammar/phpyLang.php
@@ -128,14 +128,6 @@ function resolveMacros($code) {
. ' else { ' . $args[0] . ' = null; }';
}
- if ('strKind' === $name) {
- assertArgs(1, $args, $name);
-
- return '(' . $args[0] . '[0] === "\'" || (' . $args[0] . '[1] === "\'" && '
- . '(' . $args[0] . '[0] === \'b\' || ' . $args[0] . '[0] === \'B\')) '
- . '? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED)';
- }
-
if ('prependLeadingComments' === $name) {
assertArgs(1, $args, $name);