History log of /PHP-Parser/test/PhpParser/PrettyPrinterTest.php (Results 1 – 25 of 56)
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 ...


# d3ae2ed6 21-Jul-2024 Nikita Popov

Respect version mode line in pretty printer tests

By default parser uses newest supported and pretty printer uses
its default version. If version is specified, it's used for both
par

Respect version mode line in pretty printer tests

By default parser uses newest supported and pretty printer uses
its default version. If version is specified, it's used for both
parser and printer. Additionally, parserVersion can be used to
specify a different version for parser and printer.

show more ...


# daaadc3b 03-Jun-2024 Jorg Adam Sowa

Adjust tests to be compatible with PHPUnit 10 (#998)

This avoids warnings on PHPUnit 10, without actually
switching to PHPUnit 10.


# d57da64d 31-May-2024 Jorg Adam Sowa

Add missing void return types (#997)


# 21fa9c98 17-Sep-2023 Nikita Popov

Drop some @covers annotations


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


# 8d583801 27-Aug-2023 Nikita Popov

Default pretty printer to PHP 7.4


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


# c48ee36f 09-Jul-2023 Nikita Popov

Allow passing visitors to NodeTraverser constructor


# d43edfbb 21-May-2023 Nikita Popov

Support CRLF newlines in pretty printer

Can be enabled using the "newlines" option.


# 91da1914 20-May-2023 Nikita Popov

Support readonly anonymous classes


# 57d4a026 27-Feb-2023 Nikita Popov

Handle isolated \r in doc string

Doc strings have a trailing \n and these will get interpreted as
\r\n and removed from the string contents.

For nowdoc, fall back to single quot

Handle isolated \r in doc string

Doc strings have a trailing \n and these will get interpreted as
\r\n and removed from the string contents.

For nowdoc, fall back to single quote if there's a trailing \r.
For heredoc, escape all isolated \r -- unlike \n and \r\n this is
really a special character, because this is no longer relevant as
an actual newline character.

show more ...


# 9476cff3 26-Feb-2023 Nikita Popov

Doc string end label may have leading whitespace

When detecting whether the string contains the end label, allow
leading whitespace in front of it. This is legal since the
introducti

Doc string end label may have leading whitespace

When detecting whether the string contains the end label, allow
leading whitespace in front of it. This is legal since the
introduction of flexible doc strings.

show more ...


# f6ddde64 26-Feb-2023 Nikita Popov

Perform end label check on escaped string

Escaping might convert a label character into an escape sequence
if it is not valid UTF-8.


# 47626c74 26-Feb-2023 Nikita Popov

Handle interpolated variable after end label

Interpolated variables start with non-label characters, and as
such also count as end label terminators since PHP 7.3.


# ce3337b0 26-Feb-2023 Nikita Popov

Update allowed characters after doc string label

With the introduction of flexible doc strings, the ending label
is no longer required to be followed by a semicolon or newline.
We ne

Update allowed characters after doc string label

With the introduction of flexible doc strings, the ending label
is no longer required to be followed by a semicolon or newline.
We need to prevent doc string printing if the label is followed
by any non-label character.

show more ...


# d83562e6 26-Feb-2023 Nikita Popov

Print INF as 1.0E+1000

This makes pretty printing round trip to another Float literal,
rather than a constant lookup. The 1e1000 form in particular is
chosen because that seems to be

Print INF as 1.0E+1000

This makes pretty printing round trip to another Float literal,
rather than a constant lookup. The 1e1000 form in particular is
chosen because that seems to be the typical form used in various
tests.

show more ...


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


# 66b20bd6 03-Sep-2022 Nikita Popov

Rename Scalar\DNumber to Scalar\Float_


# 8be56afd 02-Sep-2022 Nikita Popov

Rename Expr\ArrayItem to ArrayItem

Array items are not expressions by themselves.


# a5033e38 29-Aug-2022 Nikita Popov

Format tests as well

The unnecessary parentheses for "new" are a bit annoying, but I
can live with it...


# 646b4907 24-Jul-2022 Nikita Popov

Don't force newline after doc string when targeting PHP >= 7.3


# d3d1297c 06-Jun-2022 Nikita Popov

Remove PHP 5 parser


123