aa721520 | 05-Mar-2023 |
Nikita Popov |
Don't generate braces for "else if" Mentioned in #915. |
da65ae47 | 05-Mar-2023 |
Nikita Popov |
Release PHP-Parser 5.0.0 alpha 2 |
8fb71684 | 05-Mar-2023 |
Nikita Popov |
Update upgrading documentation |
b9974596 | 04-Mar-2023 |
Nikita Popov |
Update changelog |
64484a49 | 04-Mar-2023 |
Anthony Ferrara |
Add PrettyPrinter interface Closes #423. |
a0ed229b | 04-Mar-2023 |
Nikita Popov |
Revert "Rename PrettyPrinterAbstract to PrettyPrinter" This reverts commit 2217f14d6e039f1c0572329e6fcc99f6c17178a3. |
12860599 | 04-Mar-2023 |
Nikita Popov |
Set allowed exceptions in fuzzer |
698ff1ca | 04-Mar-2023 |
Nikita Popov |
Don't always omit parentheses for argument-less yield We may need parentheses around an argument-less yield to distinguish (yield) - $a from yield -$a and similar. Treat argumen
Don't always omit parentheses for argument-less yield We may need parentheses around an argument-less yield to distinguish (yield) - $a from yield -$a and similar. Treat argument-less yield like a prefix operator. This will print parentheses a bit more often than is really required, because the arity ambiguity only exists for certain operators. This seems like a reasonably good approximation through, as it only affects argument-less yield on the LHS of infix operators.
show more ...
|
7877e030 | 04-Mar-2023 |
Nikita Popov |
Handle group use special case in fuzzer Same as for normal use. |
b3158e0b | 04-Mar-2023 |
Nikita Popov |
Respect namespace style for enum scalar type printing Doesn't matter in any practical sense because such types are always invalid, but makes sure pretty printing round-trips. |
bbec9db6 | 01-Mar-2023 |
Nikita Popov |
Handle overflowing \u escape sequence |
a4728678 | 01-Mar-2023 |
Nikita Popov |
Don't skip tests with evaluate segment when generating corpus This code was adopted from test updating, but in this context we're fine with just evaluating these. |
6649012e | 01-Mar-2023 |
Nikita Popov |
Produce error if <?= used as identifier Due to a peculiarity of how <?= is handled, it can get treated as an echo identifier. Make sure it isn't, to match PHP behavior. |
2217f14d | 01-Mar-2023 |
Nikita Popov |
Rename PrettyPrinterAbstract to PrettyPrinter |
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". |
4c3e759a | 01-Mar-2023 |
Nikita Popov |
Support parsing from stdin in php-parse Following the usual convention, read from stdin if the file name is "-". |
f8fea099 | 27-Feb-2023 |
Nikita Popov |
Detect another special case in fuzzer |
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 ...
|
8e100f1e | 27-Feb-2023 |
Nikita Popov |
Handle another yield edge case match also uses =>, so we need to make sure that a trailing yield is wrapped in parentheses. |
fcd5934d | 27-Feb-2023 |
Nikita Popov |
Prevent merging of consecutive -/+ more thoroughly The unary -/+ or --/++ might not be the direct child. Instead determine this by actually printing the operand and checking whether
Prevent merging of consecutive -/+ more thoroughly The unary -/+ or --/++ might not be the direct child. Instead determine this by actually printing the operand and checking whether it starts with -/+.
show more ...
|
cc34c245 | 27-Feb-2023 |
Nikita Popov |
Fix logic for new operand parentheses requirement We need to perform this check recursively. |
68eb1ca9 | 26-Feb-2023 |
Nikita Popov |
Add fuzzing target |
cb60eda7 | 26-Feb-2023 |
Nikita Popov |
Support yield precedence Since PHP 7.0 yield is a proper expression, so print it with proper precedence. If the pretty printer is configured for older version (non-default), then alw
Support yield precedence Since PHP 7.0 yield is a proper expression, so print it with proper precedence. If the pretty printer is configured for older version (non-default), then always print parentheses. There is an interesting interaction here, in that => is resolved in favor of yield if the yield occurs as part of an array (or outer yield). This kind of bypasses the entire precedence hierarchy and *only* affects yield expressions. For the sake of simplicity this is modeled via normal LHS precedence, because this will only add unnecessary parentheses to a handful of low precedence unary operators. If desired, a special marker for this purpose could be added though.
show more ...
|
1cb460ae | 26-Feb-2023 |
Nikita Popov |
Handle throw precedence Now that this is an expression, we also need to handle precedence. |
5ad02d8a | 26-Feb-2023 |
Nikita Popov |
Run integration tests against PHP 8.2 test suite |