Commit Graph

1257 Commits

Author SHA1 Message Date
Andrey Bolonin
382ca0128f add php 7.3 to travis 2018-12-08 16:37:28 +01:00
Nikita Popov
f42bbc2403 Avoid default action for error production
error is not necessarily going to have a semantic value, make sure
that the default action $$=$1 is not used.

Fixes #551.
2018-11-30 11:00:48 +01:00
Cosmin Radoi
ebf6b1c33b Fix NodeDecoder => JsonDecoder in docs (#552) 2018-11-29 23:12:33 +01:00
Tomas Votruba
a74b54ce8b [cs] remove unused @var name 2018-11-20 20:31:31 +01:00
Romain Canon
8e4f972036 Fix wrong method call in doc 2018-11-07 17:34:08 +01:00
Nikita Popov
3d0f7843d4 Support error recovery for missing return type
The return type is set to "null" in this case.

Fixes #544.
2018-10-25 16:56:50 +02:00
Phil Davis
69068722b7 Fix typo of DONT_TRAVERSE_CURRENT_AND_CHILDREN 2018-10-11 10:16:31 +02:00
Maks Rafalko
fb3d89e463 Document new DONT_TRAVERSER_CURRENT_AND_CHILDREN constant (#540)
* Document new `DONT_TRAVERSER_CURRENT_AND_CHILDREN` constant

* Rewording sentences, added 1 space indentation to make bullet list correct
2018-10-10 21:56:48 +02:00
Nikita Popov
d0230c5c77 Release PHP-Parser 4.1.0 2018-10-10 11:24:14 +02:00
Maks Rafalko
dc323458b4 Add new constant to be returned from enterNode() to not traverse current and child nodes (#536)
* Add new constant to be returned from enterNode() to not travers current node for subsequent visitors and skip children traversing

* Allow visitors to replace nodes in leaveNode() when DONT_TRAVERSE_CURRENT_AND_CHILDREN is used
2018-10-08 22:26:00 +02:00
Matthew Brown
674c5610fb StaticCall::$name cannot be a string 2018-10-04 21:29:57 +02:00
Nikita Popov
4fb48c0e18 Mark PHP 7.3 as supported
Also bump version to PHP-Parser 4.1.
2018-09-22 10:54:21 +02:00
Tomáš Votruba
d638dd9b25 Use methods instead of annotations for expected exceptions (#533) 2018-09-22 10:43:54 +02:00
Nikita Popov
c5316487a4 Update test_old Symfony runner 2018-09-22 10:41:58 +02:00
Nikita Popov
eebaa94647 Flexible doc strings: Fix some issues, add more tests 2018-09-22 10:09:00 +02:00
Nikita Popov
0ed9065b4c Flexible doc: Validate and strip indentation
If indentation is invalid, we strip on a best-effort basis.

The error position information is not great, but I don't want to
introduce sub-token error positioning at this point in time.
2018-09-21 21:47:01 +02:00
Nikita Popov
5f73c4de80 Flexible doc: Validate end label indentation
Move doc string parsing logic from rebuildParsers.php and
String_::parseDocString() into ParserAbstract. This stuff is
going to get complicated now.

For now only implement the validation of the indentation on the
end label.
2018-09-21 16:31:17 +02:00
Nikita Popov
146411bb86 Ignore one more test...
This one is passing on Windows because the extra \r makes the
opening tag actually valid. Fails on Linux though.
2018-09-21 12:41:10 +02:00
Nikita Popov
e12891a9db Ignore failures in complex flexible doc string tests
These test nesting of flexible heredoc strings. This is too hard for
us to emulate and we do not expect to see these patterns used in the
wild.
2018-09-21 12:35:11 +02:00
Nikita Popov
a5c726bfbf Make sure heredoc end label not followed by label char 2018-09-21 11:44:39 +02:00
Nikita Popov
fd93690705 Test against more recent php-src tarball 2018-09-21 11:40:36 +02:00
Nikita Popov
83766c8c0e Partial support for flexible heredoc/nowdoc
This only implements the token emulation part, it does not yet
handle the indentation stripping.

Emulating this feature on old PHP versions is really tough and is
not going to work perfectly, but hopefully this implementation is
"good enough".
2018-09-21 11:16:00 +02:00
Nikita Popov
fa6ee28600 Release PHP-Parser 4.0.4 2018-09-18 09:03:24 +02:00
Nikita Popov
16c5d107ca Revert "Add check for leading backslash in Name ctor"
This reverts commit 2f67429ec9.

Reverting this to avoid a BC break in a patch release, will
reapply for the next major version.
2018-09-18 09:00:32 +02:00
Tomáš Votruba
d7d581c1d2 Remove NodeTraverser dependency on parent::__construct() (#528)
A parent::__construct() call is now optional when extending NodeTraverser.
2018-08-28 07:49:42 +09:00
Brent Shaffer
1973b6633a Fixes typo in AST Builder doc (#529) 2018-08-17 07:18:50 +09:00
Nikita Popov
7f96481c80 Mark PHP-Parser 3.0 as unsupported
The last release was in Febuary and there haven't been any commits
since. Make it official.
2018-07-22 21:42:51 +02:00
Nikita Popov
41408081d7 Rename setTypeHint() to setType()
To align with modern terminology -- we don't like calling these
type hints anymore. Old method name remains, marked as @deprecated.
2018-07-22 21:41:21 +02:00
Nikita Popov
4d6825c460 Add notes for new builders in docs 2018-07-22 21:33:04 +02:00
ProgMiner
d4a5a6e84b Add tests for Builder\TraitUseAdaptation 2018-07-22 21:23:00 +02:00
ProgMiner
c55798ccc6 Add tests for Builder\TraitUse 2018-07-22 21:23:00 +02:00
ProgMiner
82e8b33814 Add some trait use factory builder integration tests 2018-07-22 21:23:00 +02:00
ProgMiner
8d9ae46597 Add Builder\TraitUse::with receiving adaptation builder ability 2018-07-22 21:23:00 +02:00
ProgMiner
f6fc248ca3 Add TraitUseAdaptation and factory for it 2018-07-22 21:23:00 +02:00
ProgMiner
84dcd179d2 Add TraitUse builder and useTrait builder factory 2018-07-22 21:22:57 +02:00
Nikita Popov
3e02eb7108 Fix updateTests.php 2018-07-22 21:18:34 +02:00
Nikita Popov
2f67429ec9 Add check for leading backslash in Name ctor
Fixes #523.
2018-07-21 21:58:32 +02:00
Nikita Popov
0cd7207ca6 Add tests for var() and propertyFetch() 2018-07-20 21:59:42 +02:00
Eridan Domoratskiy
6751ac3c9d Add Variable and PropertyFetch node constructors 2018-07-20 21:49:21 +02:00
Eridan Domoratskiy
5aeb884ab5 Mention makeReturnByRef() in AST_builders.markdown (#519) 2018-07-20 21:47:07 +02:00
Nikita Popov
b855c1ca23 Add some tests for new use builders 2018-07-20 21:44:37 +02:00
Eridan Domoratskiy
53c732a96d Add useFunction() and useConst() builder methods 2018-07-20 21:38:27 +02:00
Nikita Popov
bd088dc940 Release PHP-Parser 4.0.3 2018-07-15 19:25:16 +02:00
Nikita Popov
8b1c9c0409 Store comment at end of class in Nop statement
Fixed #509.
2018-07-07 12:49:49 +02:00
openex27
df64d86cf4 Check for empty $append in safeAppend()
Can happen with Nop statements.
2018-07-07 12:34:07 +02:00
Nikita Popov
aac539ef0a Adjust test output
Whoops, forgot to commit this part.
2018-07-07 12:25:01 +02:00
Nikita Popov
f967b867d5 Improve error recovery in arrays
Similarly to missing semicolons, the error is not indicated in the
AST.

Fixes #512.
2018-07-07 12:24:06 +02:00
Gabriel Caruso
6bbdaf6c16 Remove flags from phpunit.xml that have default value and colorize (#510) 2018-07-01 23:29:44 +02:00
Nikita Popov
35b8caf75e Release PHP-Parser 4.0.2 2018-06-03 13:33:10 +02:00
Nikita Popov
6526ea2497 Throw when printin EncapsedStringPart
This needs to go through something like Encapsed or ShellExec to
determine quotation type. Explicitly throw an exception to avoid
getting an undefined method error.
2018-06-03 13:31:00 +02:00