History log of /PHP-Parser/lib/PhpParser/Lexer/Emulative.php (Results 1 – 25 of 63)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# ab51e9d3 17-Sep-2023 Nikita Popov

Remove superfluous phpdoc tags

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


# 06c7ab51 16-Sep-2023 Nikita Popov

Drop Lexer::getTokens() method

This doesn't make a lot of sense now that Lexer::tokenize() returns
the tokens.

The tokens for the last parse should be fetched via
Parser::ge

Drop Lexer::getTokens() method

This doesn't make a lot of sense now that Lexer::tokenize() returns
the tokens.

The tokens for the last parse should be fetched via
Parser::getTokens() instead.

show more ...


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


# 3c0432b0 16-Aug-2023 Nikita Popov

Remove emulation for unsupported PHP versions


# ba851243 13-Aug-2023 Nikita Popov

Replace startLexing() with tokenize()

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


# d1d784a5 13-Aug-2023 Nikita Popov

Fixup line numbers when applying emulator patches

This fixes the test failures on PHP 7.2.


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


# fb2c3ac9 20-May-2023 Nikita Popov

Fix emulative lexer with default error handler

If no error handler is provided, explicitly create one, so we don't
end up calling handleError() on null.


# 8ad41294 14-Dec-2022 Markus Staab

Declare list types (#907)

Closes #905


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


# f98341f6 17-Sep-2022 Nikita Popov

Specify more types


# 48f470ea 11-Sep-2022 Nikita Popov

Add missing return types


# dd63ddbc 28-Aug-2022 Nikita Popov

Add php-cs-fixer config and reformat

The formatting in this project has become something of a mess,
because it changed over time. Add a CS fixer config and reformat
to the desired st

Add php-cs-fixer config and reformat

The formatting in this project has become something of a mess,
because it changed over time. Add a CS fixer config and reformat
to the desired style, which is PSR-12, but with sane brace placement.

show more ...


# 1e89658c 23-Jul-2022 Nikita Popov

Add PhpVersion class


# 050342b5 04-Jul-2022 MathiasReker

Add visibility modifiers to constants

Closes GH-848.


# 653757be 04-Jul-2022 MathiasReker

Nullable type declaration for default null value

Adds ? before type declarations for parameters with a default null value


# fe9db376 05-Jun-2022 Nikita Popov

Perform token position adjustment during emulator patching


# aff98bbf 04-Jun-2022 Nikita Popov

Use PHP 8.0 token representation

Migrate everything to use PhpToken-compatible token representation,
rather than the legacy array/string representation.


# 6f1f2068 13-Nov-2021 Hassan Tariq

Fix minor typo


# def24f22 03-Sep-2021 Nikita Popov

Add support for explicit octal literals


# 55c42692 21-Jul-2021 Máté Kocsis

Add support for new PHP 8.1 modifiers (#796)

Implement support for readonly properties (https://wiki.php.net/rfc/readonly_properties_v2) and
final class contstants (https://wiki.php.net/

Add support for new PHP 8.1 modifiers (#796)

Implement support for readonly properties (https://wiki.php.net/rfc/readonly_properties_v2) and
final class contstants (https://wiki.php.net/rfc/final_class_const).

show more ...


# a8223f22 20-Mar-2021 Nikita Popov

Add emulation for enum keyword


# f66a32e2 06-Sep-2020 Nikita Popov

Emulate PHP 8 attribute syntax

Perform emulation by replacing #[ with %[, then patching % back
to # and coalescing #[ into T_ATTRIBUTE if it is a freestanding
token.


# 75abbbd2 06-Sep-2020 Nikita Popov

Handle flexible heredoc via TokenEmulator

Extend the interface to support preprocessing.


# 39b04600 06-Sep-2020 Nikita Popov

Refactor token emulator registration

Only determine needed emulators based on PHP version once, and
add an adaptor that allows treating forward and reverse emulation
the same.

Refactor token emulator registration

Only determine needed emulators based on PHP version once, and
add an adaptor that allows treating forward and reverse emulation
the same.

Previously the isEmulationNeeded() check was too conservative,
as it also considered emulators that are not relevant for the
version. Though possibly that check should just be dropped
altogether.

show more ...


123