Commit Graph

709 Commits

Author SHA1 Message Date
Nikita Popov
09086fbe0a Support partial parsing of $foo->
Introduce Error node for this purpose.
2016-07-25 17:03:58 +02:00
Nikita Popov
ec614c95dd Add hasLeadingNewline attribute to InlineHTML
Use this attribute to not print an extra newline if the original
code did not have it.
2016-07-25 16:44:25 +02:00
Nikita Popov
21b18eb294 Release version 3.0.0 alpha 1 2016-07-25 15:16:35 +02:00
Nikita Popov
faa09884db Add upgrading information 2016-07-25 15:09:21 +02:00
Nikita Popov
b740076ab1 Remove deprecated Name::set*() methods 2016-07-25 14:50:37 +02:00
Nikita Popov
c9fea2ef67 Extend Name::slice() to support negative length+offset 2016-07-25 14:47:24 +02:00
Nikita Popov
818ef2e692 Make PrettyPrinter\Standard methods protected
I'm not sure how these ever ended up being public.
2016-07-25 14:27:03 +02:00
Nikita Popov
5f97b12576 Introduce explicit Finally node 2016-07-25 14:25:04 +02:00
Nikita Popov
1dea9111a2 NodeDumper: Resolve type for include/use as well 2016-07-25 14:04:04 +02:00
Nikita Popov
174e6c3cab NodeDumper: Print modifiers as strings 2016-07-25 13:53:49 +02:00
Nikita Popov
eefcfeed23 Remove analyze.php
Has outlived its usefulness...
2016-07-25 13:38:05 +02:00
Nikita Popov
18129480ae Rename $type subnode to $flags
Type makes it sound like a type-hint, and on a number of other nodes
$type is used for exactly that. Use $flags to hold modifiers instead.
2016-07-25 13:33:19 +02:00
Nikita Popov
1b1ff8995b Update some PHP version numbers 2016-07-22 17:07:56 +02:00
Nikita Popov
867ae5148d Bring Trait constructor in line with Class/interface 2016-07-22 17:01:51 +02:00
Nikita Popov
72e91845e4 Update changelog 2016-07-22 16:55:17 +02:00
Nikita Popov
537b59d4d1 PHP 7.1: Support multi-catch
Catch::$type is now an array Catch::$types.
2016-07-22 15:40:00 +02:00
Nikita Popov
7ff12b8fcb Remove deprecated Comment methods 2016-07-09 22:00:39 +02:00
Nikita Popov
574665b45b PHP 7.1: list() with keys
Expr\List will now contain ArrayItems instead of plain variables.
I'm reusing ArrayItem, because code handling list() must also handle
arrays, and this allows both to go through the same code path.

This also renames Expr\List->vars to ->items.

TODO: Should Expr\List be dropped in favor of Expr\Array with an
extra flag?
2016-07-09 21:55:55 +02:00
Nikita Popov
437890d386 PHP 7: Short destructuring syntax
Potentially the pretty printer should force use of [] in assignment
context, instead of relying on the existance of the right attribute.
2016-07-06 23:43:23 +02:00
Nikita Popov
1edf72c040 PHP 7: Support nullable types
Using a new NullableType node.
2016-07-06 18:36:18 +02:00
Nikita Popov
7a54aca468 Merge branch '2.x' 2016-07-06 02:21:57 +02:00
Nikita Popov
81f7da3b23 Fix computation of expected tokens in parse errors 2016-07-06 02:21:48 +02:00
Nikita Popov
5ea2a76d80 PHP 7.1: Class constant visibility support 2016-07-05 23:01:06 +02:00
Nikita Popov
5044fce1ff PHP 7.1: Add void+iterable support
In PHP 7 mode, these will now be represented as strings 'void'
and 'iterable'.
2016-07-05 22:35:27 +02:00
Nikita Popov
038e11da4b Remove support for PHP 5.4 2016-07-05 22:29:41 +02:00
Nikita Popov
225804c147 Targeting PHP-Parser 3.0 2016-07-05 22:24:52 +02:00
Nikita Popov
96cbd48df6 Improve error recovery quality
In particular, support recovering from a missing trailing semicolon,
while keeping the rest of the expression.
2016-04-20 16:47:50 +02:00
Nikita Popov
e45e31c218 Fix new.test and code test runner
Using only the basename leads to collisions...
2016-04-20 15:03:18 +02:00
algo13
371c783344 Escape all low control characters in strings 2016-04-19 17:45:39 +02:00
Nikita Popov
47b254ea51 Release PHP-Parser 2.1.0 2016-04-19 15:41:41 +02:00
Nikita Popov
912c0bb9c9 Document that XDebug is super slow 2016-04-19 15:40:08 +02:00
Nikita Popov
9897fa8819 Update CHANGELOG 2016-04-19 15:32:57 +02:00
Nikita Popov
5a6e7dd452 Avoid superfluous newline when printing Nops 2016-04-19 15:10:51 +02:00
Nikita Popov
90eb1165d1 Switch Exit kind attribute to flag
To be consistent with everything else.
2016-04-19 14:51:05 +02:00
Nikita Popov
cf9b9e2afa Switch to 2.1-dev 2016-04-19 14:51:04 +02:00
Nikita Popov
e7869b9f14 Forbid invalid octals in PHP 7 mode 2016-04-18 13:59:18 +02:00
Nikita Popov
4c7ad7e194 Allow nop statements before namespace declaration 2016-04-16 21:39:49 +02:00
Remi Collet
f8a40b3f24 Make autoloader more PSR-4 (#268) 2016-04-15 15:07:30 +02:00
Nikita Popov
82bb6627c9 Drop superfluous newlines before help text 2016-04-15 14:36:11 +02:00
Remi Collet
d1dd9f5aec support -h and --help standard options 2016-04-15 14:34:28 +02:00
Graham Campbell
e7f0860d85 Tweaked a phpdoc description 2016-04-10 21:10:55 +09:00
Nikita Popov
954051f240 Run test_old using php -n
Xdebug is killing performance.
2016-04-10 21:09:02 +09:00
lvht
39f93f09f9 Add setReturnType() method to function/method builders
Also support scalar type hints in existing setTypeHint() method on params.
2016-04-09 18:41:38 +09:00
Nikita Popov
2d0c3b70f8 Fix .travis.yml 2016-04-07 07:39:20 +02:00
Nikita Popov
4252ffa43e Run test_old against php-src on travis 2016-04-07 06:39:29 +02:00
Nikita Popov
8cacc85913 "Fix" HHVM build 2016-04-07 12:27:08 +09:00
Nikita Popov
588e6a4d4c Add string kinds and doc string labels
Scalar\String_ and Scalar\Encapsed now have an additional "kind"
attribute, which may be one of:

 * String_::KIND_SINGLE_QUOTED
 * String_::KIND_DOUBLE_QUOTED
 * String_::KIND_NOWDOC
 * String_::KIND_HEREDOC

Additionally, if the string kind is one of the latter two, an
attribute "docLabel" is provided, which contains the doc string
label (STR in <<<STR) that was originally used.

The pretty printer will try to take the original kind of the string,
as well as the used doc string label into account.
2016-04-07 12:09:00 +09:00
Nikita Popov
fa6a17755a Add two files to test_old skip list
The parse after pretty printing differs here, because these tests
contain nop (;) statements, which the pretty printer does not
preserve.
2016-04-07 11:58:36 +09:00
Nikita Popov
52cb5ecec7 Fix comment reformatting for some cases
It did not correctly deal with non-standard comments containing
indented lines.
2016-04-07 11:47:40 +09:00
Nikita Popov
1565a2815d Add --verbose option to test_old/run.php 2016-04-05 19:19:20 +09:00