History log of /PHP-Parser/lib/PhpParser/ParserAbstract.php (Results 1 – 25 of 124)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 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 ...


# acfccd9d 01-Nov-2023 Nikita Popov

Run with updated php-cs-fixer


# 4e27a17c 06-Jun-2022 Nikita Popov

Use visitor to assign comments

This fixes the long-standing issue where a comment would get assigned
to all nodes with the same starting position, instead of only the
outer-most one.

Use visitor to assign comments

This fixes the long-standing issue where a comment would get assigned
to all nodes with the same starting position, instead of only the
outer-most one.

Fixes #253.

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 ...


# ab51e9d3 17-Sep-2023 Nikita Popov

Remove superfluous phpdoc tags

These just specify a type that is already specified as a real PHP
type.


# 2d3dd4e2 17-Sep-2023 Nikita Popov

Don't align phpdoc tags

I did this to start with, but then alignment kept being broken
during refactorings, and at some point I switched to not aligning,
and now we have a big mess.

Don't align phpdoc tags

I did this to start with, but then alignment kept being broken
during refactorings, and at some point I switched to not aligning,
and now we have a big mess.

Add a php-cs-fixer rule to consistently not align phpdoc tags.

show more ...


# ea778075 17-Aug-2023 Nikita Popov

Add more property types

Some of these are not maximally accurate due to lack of union
types.


# 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 ...


# ba851243 13-Aug-2023 Nikita Popov

Replace startLexing() with tokenize()

For now Lexer::getTokens() still exists, but should probably be
removed.


# 62853b17 13-Aug-2023 Nikita Popov

Fix PhpStan errors


# 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.


# c62dda95 01-Mar-2023 Nikita Popov

Strip trailing doc string newline before parsing escape sequences

If the doc string ends on an escaped \r, it should not get eaten
as the "last newline".


# f98341f6 17-Sep-2022 Nikita Popov

Specify more types


# 032b1021 11-Sep-2022 Nikita Popov

Remove deprecated Error constructor

And use this chance to provide accurate position information for
namespace errors.


# a099803d 11-Sep-2022 Nikita Popov

Use array<string, mixed> type for $attributes

Slightly more accurate, and stops PHPStan from complaining about
the missing array type information.


# 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.


# 031c5e6e 11-Sep-2022 Nikita Popov

Move verifyModifier/verifyClassModifier to Modifiers class

Now that the Modifiers are in a separate class, these *internal*
verification methods should also be moved there.


# b9fe3449 11-Sep-2022 Nikita Popov

Add missing parameter types


# 8dfce13d 11-Sep-2022 Nikita Popov

Add phpstan baseline


# 4917c71a 03-Sep-2022 Nikita Popov

Rename Stmt\UseUse to UseItem


# 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.


# 23835d20 03-Sep-2022 Nikita Popov

Rename Scalar\LNumber to Scalar\Int_


12345