Commit Graph

220 Commits

Author SHA1 Message Date
Nikita Popov
90ab32f046 Merge branch '1.x' 2015-07-05 20:16:41 +02:00
Nikita Popov
7434a682e5 Fix implicit visibility for properties as well
Also switch to using PPP mask.
2015-07-05 20:16:21 +02:00
Lisachenko Alexander
5e6627c895 Add broken test for implicit public nodes 2015-07-05 20:10:47 +02:00
Nikita Popov
f872fa9b0b Merge branch '1.x' 2015-07-04 14:40:53 +02:00
Nikita Popov
d5668f536d Fix __HALT_COMPILER_OFFSET__ support on HHVM 2015-07-04 13:15:48 +02:00
Nikita Popov
9c9a8cddce Merge branch '1.x' 2015-06-20 12:34:36 +02:00
Nikita Popov
fd7ee2e083 Add missing regex anchor 2015-06-20 12:34:10 +02:00
Nikita Popov
f2b7a31509 Rename ParserInterface to Parser
And drop the alias of Parser to Parser\Php5.
2015-06-20 11:47:25 +02:00
Nikita Popov
d8312a09a3 Split parsing tests into code tests and other stuff
And run the other stuff against Php5 and Php7 parsers.

Also move canonicalize() from CodeTestAbstract into a free-standing
function.
2015-06-20 11:44:29 +02:00
Nikita Popov
ef9a154d09 Add support for unicode escape sequences
Only parsed if the PHP 7 parser is used.
2015-06-13 20:51:02 +02:00
Nikita Popov
0da72fad00 Support scalar type declarations 2015-06-13 20:16:09 +02:00
Nikita Popov
71fa7c6674 Support UVS in pretty printer
Try to generate interoperable code where possible (but not
everything can be expressed in PHP 5).
2015-06-13 20:01:01 +02:00
Nikita Popov
f3f24e03ae Support running against PHP 7 testsuite 2015-06-13 19:09:24 +02:00
Nikita Popov
bc21514ecf Move token constants into separate class
As these are shared between Php5 and Php7 parsers they should be
in some common place, otherwise we'd have to always reference either
one or the other.
2015-06-13 18:39:55 +02:00
Nikita Popov
04e05907c3 Fix CRLF issue in Serializer\XML test
No idea why this suddenly turned up now.
2015-06-13 18:20:05 +02:00
Nikita Popov
61e060694d Implement generalized yield operator
And split tokens.y off, so I don't waste time debugging this again...
2015-06-13 18:11:40 +02:00
Nikita Popov
602b9807eb Import some UVS tests 2015-06-13 15:42:09 +02:00
Nikita Popov
f372a4c4ab Move modeline handling into CodeTestAbstract 2015-06-13 15:10:46 +02:00
Nikita Popov
d18dcc0c7f Implement UVS 2015-06-13 14:59:24 +02:00
Nikita Popov
74c57eef0e Test PHP 5 and PHP 7 parsers
At this point they should return the same result.
2015-06-13 13:56:45 +02:00
Nikita Popov
dca46febc9 Implement semi-reserved identifiers 2015-06-13 12:47:13 +02:00
Nikita Popov
1a1bd1448d Support mixed group use declarations 2015-06-13 11:27:38 +02:00
Nikita Popov
9620f79cdc Add partial group use support
Supported via Stmt\GroupUse which has Name $prefix in addition to
the usual.

Still missing: Mixed group uses.
2015-06-12 23:05:28 +02:00
Nikita Popov
5d1e3be7d4 Anonymize some callbacks 2015-05-02 22:35:15 +02:00
Nikita Popov
cc75dd3612 Drop support for PHP 7 aliases 2015-05-02 22:21:12 +02:00
Nikita Popov
5f621c5adc Drop support for legacy aliases from v0.9 2015-05-02 22:19:25 +02:00
Nikita Popov
29b9015f51 Drop support for old Node format 2015-05-02 22:17:34 +02:00
Nikita Popov
8b64195cf2 Try .17G print if .16G is not enough
This should be enough for all cases, because: A double has 53 bits
of mantissa (including the implicit 1 bit), which is 53*ln(2)/ln(10)
= 15.95 decimal digits. However the leading decimal digit may encode
less than the usual 3.32 bits, which will push this over the edge to
requiring 17 decimal digits.
2015-05-02 11:48:55 +02:00
Nikita Popov
9caa51b3a5 Add some more tests 2015-05-01 20:18:04 +02:00
Nikita Popov
648800f07f Increase float pretty printing precision
This removes the reliance on the "precision" ini setting.
Furthermore the default of precision=14 is not sufficient.
2015-05-01 19:15:33 +02:00
Nikita Popov
23bf4f0c13 Add some error documentation 2015-04-30 21:58:45 +02:00
Nikita Popov
272ab6c8d8 Add some recovery tests 2015-04-30 19:02:51 +02:00
Nikita Popov
0731b47655 Don't distinguish test-fail / test
With error recovery this is fluid. Using .test for everything.
2015-04-30 17:45:36 +02:00
Nikita Popov
3b7d8e8b5d Enable basic error recovery
Adding only a single recovery rule for now.

The API is now:
 * throwOnError parser option must be disabled.
 * List of Errors is available through $parser->getErrors(). This
   method is available either way.
 * If no recovery is possible $parser->parse() will return null.
   (Obviously only if throwOnError is disabled).
2015-04-30 17:41:57 +02:00
Nikita Popov
a35c2a2067 Add column info to EOF errors
EOF errors are now located one past the end of the file.
2015-04-27 15:37:41 +02:00
Nikita Popov
55b2ead967 Make special class name checks case insensitive 2015-04-26 23:13:27 +02:00
Nikita Popov
e1a0ec3724 Add support for anonymous classes
Has not landed upstream yet, but syntax is unlikely to change.
2015-04-26 23:04:31 +02:00
Nikita Popov
338bc1f8e7 Fix "print" pretty-printing
Precedence was previously ignored.
2015-04-26 11:56:04 +02:00
Nikita Popov
ab80054e97 Add support for "yield from" 2015-04-26 11:56:02 +02:00
Nikita Popov
c8454271e1 Make column info 1-based 2015-04-18 21:20:45 +02:00
Nikita Popov
62f83a0dc2 Add column info for non-syntax errors where relatively precise
Should it also be added if only rough information is available? E.g.
spanning an entire class?
2015-04-18 13:27:58 +02:00
Nikita Popov
611fa5c7f1 Test parser position information (syntax errors) 2015-04-18 13:27:57 +02:00
Nikita Popov
4defbc2174 Make Error column info attribute based 2015-04-18 12:51:26 +02:00
Gerrit Addiks
33a39fae06 added column-numbers to syntax errors 2015-04-18 10:14:49 +02:00
Nikita Popov
617bf0aa41 Fix registering of PHP 7 aliases
The previous approach was causing issues, because "instanceof"
does not invoke the autoloader.
2015-03-24 20:04:50 +01:00
Nikita Popov
dce19b074b Strict type compliance
Were this library to be fully annotated with scalar types and
return types where possible and were strict types to be enabled
for all files, the test suite would now pass.
2015-03-24 11:19:17 +01:00
Matthieu Napoli
729c7bde0c #184 Add a flag to NodeTraverser to avoid cloning nodes 2015-03-22 11:19:04 +13:00
Nikita Popov
8982315b4e Rename Cast\Object as well
As it will very likely be soft-reserved in PHP 7.

Old alias is still available, as usual.
2015-03-21 18:57:55 +01:00
Nikita Popov
7ec277e1e1 Replace another Scalar\String occurance
Also canonicalize NameResover tests to avoid those pesky CRLF
issues.
2015-03-21 18:47:20 +01:00
Nikita Popov
1a627872f0 Rename nodes for compat with PHP 7
The old names will still be available on PHP 5.x.
2015-03-20 21:49:38 +01:00