History log of /PHP-Parser/lib/PhpParser/Parser/Php7.php (Results 1 – 25 of 168)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 7b0384cd 25-May-2024 Nikita Popov

[8.4] Add support for new deref without parens

RFC: https://wiki.php.net/rfc/new_without_parentheses


# af14fdb2 21-Feb-2024 Nikita Popov

Avoid cyclic reference in parser

Pass $this as an explicit $self argument to the reduce callbacks,
so we can make them static. This avoids a circular reference in
the parser, so that

Avoid cyclic reference in parser

Pass $this as an explicit $self argument to the reduce callbacks,
so we can make them static. This avoids a circular reference in
the parser, so that it can be immediately destroyed when it goes
out of scope.

Fixes #980.

show more ...


# 8d50e9d0 03-Oct-2023 xjaja <5057757+xjaja@users.noreply.github.com>

Don't drop class statements before error (#952)

When encountering a null statement (indicating that an error occurred),
retain the preceding statements. These were accidentally dropped

Don't drop class statements before error (#952)

When encountering a null statement (indicating that an error occurred),
retain the preceding statements. These were accidentally dropped
previously.

(cherry picked from commit 54103d838734be0499172026525e38cbf6af2711)

show more ...


# b4183c2b 25-Sep-2023 Nikita Popov

Remove Stmt\Throw

This was a backwards-compatibility shim for Expr\Throw.


# a1ccf577 24-Sep-2023 Nikita Popov

Introduce Stmt\Block

Stmt\Block will be created for { $a; } style blocks, unless these
occur directly inside some structure that is usually combined
with a block.

For exampl

Introduce Stmt\Block

Stmt\Block will be created for { $a; } style blocks, unless these
occur directly inside some structure that is usually combined
with a block.

For example if ($a) { $b; } will continue to use the old
representation (plain array in in If_::$stmts), but a free-standing
{ $b; } will become a Stmt\Block.

Fixes #590.

show more ...


# f5adbb5e 24-Sep-2023 Nikita Popov

Add rawValue to InterpolatedStringPart and doc strings

For doc strings, the rawValue (on either the String_ or
InterpolatedStringPrts) does not include the leading indentation
(which

Add rawValue to InterpolatedStringPart and doc strings

For doc strings, the rawValue (on either the String_ or
InterpolatedStringPrts) does not include the leading indentation
(which is available as docIndentation) or the trailing newline on
the last part.

show more ...


# d8e80653 23-Sep-2023 Nikita Popov

Don't parse unicode escapes for PHP < 7.0

We still had the option for this but were hardcoding it to true.
Make it conditional on the PHP version instead.


# 502b0909 16-Aug-2023 Nikita Popov

Add property types

Types omitted in two places where we violate them currently:
Namespace_::$stmts can be null during parsing, and Enum_::$scalarType
can be a complex type for invali

Add property types

Types omitted in two places where we violate them currently:
Namespace_::$stmts can be null during parsing, and Enum_::$scalarType
can be a complex type for invalid programs.

show more ...


# 4b497045 29-Jul-2023 Nikita Popov

Move attribute handling into parser

The Lexer now only provides the tokens to the parser, while the
parser is responsible for determining which attributes are placed
on notes. This o

Move attribute handling into parser

The Lexer now only provides the tokens to the parser, while the
parser is responsible for determining which attributes are placed
on notes. This only needs to be done when the attributes are
actually needed, rather than for all tokens.

This removes the usedAttributes lexer option (and lexer options
entirely). The attributes are now enabled unconditionally. They
have less overhead now, and the need to explicitly enable them for
some use cases (e.g. formatting-preserving printing) doesn't seem
like a good tradeoff anymore.

There are some additional changes to the Lexer interface that
should be done after this, and the docs / upgrading guide haven't
been adjusted yet.

show more ...


# b20267c5 09-Jul-2023 Nikita Popov

Make use of default actions

For the default action $$ = $1, save the closure invocation.


# 91da1914 20-May-2023 Nikita Popov

Support readonly anonymous classes


# 5c267f55 20-May-2023 Nikita Popov

Add support for typed constants

RFC: https://wiki.php.net/rfc/typed_class_constants


# 6649012e 01-Mar-2023 Nikita Popov

Produce error if <?= used as identifier

Due to a peculiarity of how <?= is handled, it can get treated as
an echo identifier. Make sure it isn't, to match PHP behavior.


# cd3c0c11 26-Feb-2023 Nikita Popov

Remove __halt_compiler from semi reserved keyword list

Apparently PHP does not allow use of __halt_compiler as a
semi-reserved keyword.


# 2df8878f 29-Jan-2023 Nikita Popov

[PHP 8.3] Support dynamic class const fetch

RFC: https://wiki.php.net/rfc/dynamic_class_constant_fetch


# 0dd85ebd 18-Sep-2022 Nikita Popov

Support readonly before DNF type

This makes us match the PHP 8.2 handling of readonly. Handling of
"readonly" functions is moved to the parser to allow distinguishing
them from reado

Support readonly before DNF type

This makes us match the PHP 8.2 handling of readonly. Handling of
"readonly" functions is moved to the parser to allow distinguishing
them from readonly properties with DNF types. We have to uglify the
grammar to avoid some shift/reduce conflicts. Thank you WordPress.

show more ...


# 48f470ea 11-Sep-2022 Nikita Popov

Add missing return types


# 9b46dffb 11-Sep-2022 Nikita Popov

Fix formatting preservation for alternative elseif/else syntax

Test taken from PR #797.


# f59f226f 11-Sep-2022 Nikita Popov

Fix some phpstan warnings


# 636f066b 05-Sep-2022 Nikita Popov

Use Node\ClosureUse instead of Expr\ClosureUse in parser

Fixes #883.


# 4917c71a 03-Sep-2022 Nikita Popov

Rename Stmt\UseUse to UseItem


# e1345f0c 03-Sep-2022 Nikita Popov

Rename Stmt\PropertyProperty to PropertyItem


# 03ccfa3d 03-Sep-2022 Nikita Popov

Rename Stmt\DeclareDeclare to DeclareItem


# a44faa63 03-Sep-2022 Nikita Popov

Rename Scalar\Encapsed to Scalar\InterpolatedString


# f4ec6a1e 03-Sep-2022 Nikita Popov

Rename Scalar\EncapsedStringPart to InterpolatedStringPart

It is no longer an expression node, which unfortunately does
require a more awkward type for the Encaps node.


1234567