History log of /PHP-Parser/lib/PhpParser/Internal/TokenStream.php (Results 1 – 18 of 18)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# e50c67b7 21-Sep-2024 Nikita Popov

Add basic support for tab indentation

Add a new "indent" option for the pretty printer, which can be
use to control the indentation width, or switch it to use tabs.

Tab width is

Add basic support for tab indentation

Add a new "indent" option for the pretty printer, which can be
use to control the indentation width, or switch it to use tabs.

Tab width is currenlty hardcoded to 4, but also shouldn't matter
much.

Possibly the formatting-preserving printer should auto-detect
the indentation in the future.

show more ...


# 70c96493 02-Mar-2024 Nikita Popov

Fix indentation detection after opening tag

Fixes #982.


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


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


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


# b0edd4c4 21-Sep-2022 Nikita Popov

Bail out on PHP tags in removed code

If dropping a node would drop PHP tags, bail out of formatting
preservation. This will lose formatting, but at least produce
legal code.

Bail out on PHP tags in removed code

If dropping a node would drop PHP tags, bail out of formatting
preservation. This will lose formatting, but at least produce
legal code.

Closes GH-884.

show more ...


# fc6b4890 11-Sep-2022 Nikita Popov

Specify more types


# 48f470ea 11-Sep-2022 Nikita Popov

Add missing return types


# b9fe3449 11-Sep-2022 Nikita Popov

Add missing parameter 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 ...


# b4902cef 10-Jun-2022 Romain

optimization haveTokenImmediatelyAfter performance


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


# 9c5eb3cc 04-Jun-2022 Nikita Popov

Add some missing type annotations


# c64986fa 03-Dec-2020 Tommy Quissens

Allow both '{' and T_CURLY_OPEN as curly bracket (#732)


# ad365b1b 29-Aug-2020 Nikita Popov

FPPP: Fix code block detection during removal

Instead of checking whether there is a {/} before/after the removed
note, check whether {/} occurs in the between-node range. Dropping
t

FPPP: Fix code block detection during removal

Instead of checking whether there is a {/} before/after the removed
note, check whether {/} occurs in the between-node range. Dropping
that is what we're really concerned about here.

show more ...


# bd722809 23-Aug-2020 Nikita Popov

FPPP: Support removing nodes from start of list


Revision tags: v4.3.0, v4.2.5, v4.2.4, v4.2.3, v4.2.2, v4.2.1, v4.2.0, v4.1.1, v4.1.0, v4.0.4, v4.0.3, v4.0.2, v4.0.1, v4.0.0, v3.1.5, v4.0.0beta1
# d817818b 27-Jan-2018 Nikita Popov

Move TokenStream into Internal namespace