History log of /PHP-Parser/test/code/parser/nopPositions.test (Results 1 – 4 of 4)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 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 ...


# 9a5d5c11 20-May-2023 Nikita Popov

Add newline at end of file for many tests

Add the newline in reconstructTest() and run updateTests.php, to
reduce spurious diffs in the future.


# 46cbd939 09-Feb-2020 Nikita Popov

Place Nop nodes more precisely

If the Nop is created to collect comments, place it directly after
the comment, instead of at the next non-whitespace character.


Revision tags: v4.3.0, v4.2.5, v4.2.4, v4.2.3, v4.2.2
# 60d025a9 11-May-2019 Nikita Popov

Fix attributes for zero-length nop nodes

Previously zero-length nop nodes used the lookahead start attributes
and current end attributes. This choice ends up being somewhat weird,
be

Fix attributes for zero-length nop nodes

Previously zero-length nop nodes used the lookahead start attributes
and current end attributes. This choice ends up being somewhat weird,
because the end attributes will be the at the last non-whitespace,
non-comment token, which might be quite far back. More problematically,
we may not have encountered any non-discarded token if we're at the
start of the file, in which case we will have no end attributes to
assign.

Change things to use a canonical "zero-length" node representation,
where the end position (token & file) will be exactly one before the
start position.

Fixes #589.

show more ...