Commit Graph

504 Commits

Author SHA1 Message Date
Dmitry Stogov
a75c195000 Implemented the RFC Support Class Constant Visibility.
Squashed commit of the following:

commit f11ca0e7a5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:38:42 2015 +0300

    Fixed test expectation

commit 211f873f54
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:28:38 2015 +0300

    Embed zend_class_constant.flags into zend_class_constants.value.u2.access_flags

commit 51deab84b2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Dec 7 11:18:55 2015 +0300

    Fixed issues found by Nikita

commit 544dbd5b47
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Dec 5 02:41:05 2015 +0300

    Refactored immplementation of https://wiki.php.net/rfc/class_const_visibility
    @reeze created an RFC here and I emailed internals here and didn't get any responses positive/negative.
2015-12-08 12:40:42 +03:00
Xinchen Hui
05738eb71a Revert "Improved fix for Fully qualified (leading backslash) type names must fail"
This reverts commit 00865ae22f.
2015-11-25 19:06:42 +08:00
Xinchen Hui
00865ae22f Improved fix for Fully qualified (leading backslash) type names must fail
it now all fails with COMPILE_ERROR instead of syntax error for T_ARRAY
but COMPILE_ERROR for int
2015-11-25 11:27:32 +08:00
Nikita Popov
e3e92e96c1 Fixed bug #70430 2015-10-15 22:14:23 +02:00
Nikita Popov
06f38d36a8 Reindent zend_yytnamerr
Separating this whitespace change from the next diff.
2015-10-15 22:13:14 +02:00
Márcio Almada
ddb6d7801e Fix bug #70650 2015-10-07 16:25:59 +02:00
Márcio Almada
c08b3922dd adds missing tokens to list of semi-reserved words and regenerates test suite 2015-09-04 15:02:50 +02:00
Nikita Popov
186b0f3770 Don't allow leading \ in group use decl list
We recently added support for "use \Foo\{Bar}". This commit drops
support for the reverse "use Foo\{\Bar}". Those two got mixed up
in the initial implementation.
2015-08-20 11:47:43 +02:00
Márcio Almada
7568d5cb89 fixes a syntactical inconsistency with group use and leading \
discussion: http://news.php.net/php.internals/87774
2015-08-18 19:23:58 -03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Nikita Popov
a684e6adb2 Drop unnecessary %prec
Leftover from a previous implementation
2015-06-20 13:10:51 +02:00
Xinchen Hui
438d17e74e Even fake token better to be in upper case 2015-05-26 18:11:07 +08:00
Bob Weinand
31f3eeb0c5 Fix tokenizer test due to recent changes 2015-05-26 00:17:27 +02:00
Bob Weinand
69b54ba926 Also unreserve T_CLASS 2015-05-25 22:58:30 +02:00
Bob Weinand
36c3c47434 Set %expect to 0 in parser (Using %prec) 2015-05-25 20:26:57 +02:00
Bob Weinand
21ccdf6304 Rebuild scanner, add NEWS/UPGRADING 2015-05-25 19:00:08 +02:00
Márcio Almada
110759386e ext tokenizer port + cleanup unused lexer states
we basically added a mechanism to store the token stream during parsing
and exposed the entire parser stack on the tokenizer extension through
an opt in flag: token_get_all($src, TOKEN_PARSE).

this change allows easy future language enhancements regarding context
aware parsing & scanning without further maintance on the tokenizer
extension while solves known inconsistencies "parseless" tokenizer
extension has when it handles `__halt_compiler()` presence.
2015-04-30 03:03:29 -03:00
Márcio Almada
a75decd452 implement context sensitive language with lexical feedback
The implementation has no regression risks, has an even smaller footprint
compared to the previous attempt involving a pure lexical approach, is higly
predictable and higly configurable.

To turn a word semi-reserved you only need to edit the "SEMI_RESERVED" parser rule,
it's an inclusive list of all the words that should be matched as T_STRING on specific contexts.
Example:

```
method_modifiers function returns_ref indentifier '(' parameter_list ')' ...
```

instead of:

```
method_modifiers function returns_ref T_STRING '(' parameter_list ')' ...
```

TODO: port ext tokenizer
2015-04-30 03:03:29 -03:00
Nikita Popov
f2f890a256 More cleanup (mainly retab) 2015-04-26 15:54:30 +02:00
krakjoe
49608e0608 Rebase Joe's anon classes implementation 2015-04-26 15:04:22 +02:00
Bob Weinand
f3e124d58d Merge branch 'coroutineDelegation' of https://github.com/bwoebi/php-src 2015-04-14 17:58:58 +02:00
Nikita Popov
a8bf1c5d8f Throw ParseException from lexer
Primarily to avoid getting fatal errors from token_get_all().

Implemented using a magic E_ERROR token, which the lexer emits to
force a parser failure.
2015-04-02 16:31:17 +02:00
Xinchen Hui
eeb8eced9b Improved parser (make use_type reuseable) 2015-03-16 18:43:36 +08:00
Márcio Almada
22d6cc7c8c fix compilation warnings, rename batch_use to group_use 2015-03-08 12:50:57 -03:00
Márcio Almada
344fc25b12 require trailing T_NS_SEPARATOR #1005 2015-03-07 17:59:48 -03:00
Márcio Almada
fbde890ee2 allow non mixed use declarations, CC @nikic #1005
```
use function N\S { foo, bar, etc };
use const N\S { FOO, BAR, ETC };
```

Related tests:

```
make test -j4 TESTS="-m Zend/tests/ns_0{88..92}*.phpt"
```

All namespace tests:

```
make test -j4 TESTS="Zend/tests/ns_*.phpt"
```
2015-03-07 17:59:48 -03:00
Márcio Almada
275e7276c1 first implementation of batch use compilation 2015-03-07 17:59:48 -03:00
Bob Weinand
b4a142ab97 Added yield from operator 2015-03-07 00:28:12 +01:00
Nikita Popov
fcdb6e0811 WIP 2015-02-28 21:20:37 +01:00
Stanislav Malyshev
3551083c2c Merge branch 'pull-request/1007'
* pull-request/1007:
  Fix associativity to match Perl
  Blast off to space.
2015-02-18 08:48:17 +01:00
Márcio Almada
e9f99e3d71 Márcio Almada remove dead tokens: T_CHARACTER, T_BAD_CHARACTER. 2015-02-08 21:44:44 -03:00
Andrea Faulds
d8b7a4480b Fix associativity to match Perl 2015-01-29 17:56:09 +00:00
Andrea Faulds
797dee59cd Blast off to space. 2015-01-29 17:56:09 +00:00
Levi Morrison
c8576c5a46 Implement return types
RFC is documented here: https://wiki.php.net/rfc/return_types
2015-01-27 11:49:56 -07:00
Nikita Popov
4d3e4d3bf9 Remove assignment of new by reference 2015-01-26 21:00:22 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Guilherme Blanco
d51fb69c01 Removed parsing support traits to have extends and implements. 2015-01-09 15:45:02 +01:00
Guilherme Blanco
f48c232740 Decoupled class declaration statement into more granular pieces. 2015-01-09 15:45:01 +01:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
bb66f385d0 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (37 commits)
  NEWS
  NEWS
  Fix bug #68601 buffer read overflow in gd_gif_in.c
  Fixed compilation warnings
  Removed unnecessary checks
  pcntl_signal_dispatch: Speed up by preventing system calls when unnecessary
  Merged PR #911.
  Removed ZEND_ACC_FINAL_CLASS which is unnecessary. This also fixed some currently defined classes as final which were just not being considered as such before.
  Updated NEWS
  Updated NEWS
  Updated NEWS
  Fix bug #68532: convert.base64-encode omits padding bytes
  Updated NEWS
  Updated NEWS
  Updated NEWS
  Fixed Bug #65576 (Constructor from trait conflicts with inherited constructor)
  Updated NEWS
  Updated NEWS
  Fix MySQLi tests
  Fixed gd test
  ...
2014-12-13 19:43:45 +01:00
Guilherme Blanco
094d409b3d Removed ZEND_ACC_FINAL_CLASS which is unnecessary. This also fixed some currently defined classes as final which were just not being considered as such before. 2014-12-12 17:29:54 +01:00
Dmitry Stogov
e087d3ac7f Merge branch 'master' into native-tls
* master: (23 commits)
  move the test to the right place
  fix TS build and C89 compat
  updated NEWS
  Fixed bug #68545 NULL pointer dereference in unserialize.c
  Updated NEWS
  Updated NEWS
  Updated NEWS
  NEWS
  Fix bug #68526 Implement POSIX Access Control List for UDS
  Improved basic zval copying primitives: ZVAL_COPY_VALUE(), ZVAL_COPY(), ZVAL_DUP()
  Wrap RETURN_VALUE_USED() with EXPECTED() or UNEXPECTED() macros according to more frequent usage patterns.
  Improved ASSIGN_<OP>, ASSIGN_DIM and UNSET_DIM
  drop dead/unused code
  simplified code
  Move ZVAL_DEREF() and make_real_object() into slow paths.
  Pass znode_op structure by value (it fits into one word) instead of pointer to structure.
  Move checks for references into slow paths.
  Improved ASSIGN_DIM and ASSIGN_OBJ
  Fixed typo
  Move checks for references into slow paths of handlers or helpers. Remove duplicate opcode handlers.
  ...
2014-12-10 23:24:11 +03:00
Nikita Popov
c6d0c55a23 Fix arrow operator precedence
I accidentially added => as the highest-precedence operator...
2014-12-07 23:00:48 +01:00
Anatol Belski
c6bad96f30 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (398 commits)
  NEWS
  add test for bug #68381
  Fixed bug #68381 Set FPM log level earlier during init
  proper dllexport
  move to size_t where zend_string is used internally
  fix some datatype mismatches
  return after the warning, to fix uninitialized salt usage
  fix datatype mismatches
  add missing type specifier
  fix datatype mismatches
  fix unsigned check
  "extern" shouldn't be used for definitions
  joined identical conditional blocks
  simplify fpm tests
  SEND_VAR_NO_REF optimization
  Add test for bug #68442
  Add various tests for FPM - covering recent bugs (68420, 68421, 68423, 68428) - for UDS - for ping and status URI - for multi pool and multi mode
  Include small MIT FastCGI client library from https://github.com/adoy/PHP-FastCGI-Client
  Get rid of zend_free_op structure (use zval* instead). Get rid of useless TSRMLS arguments.
  Add new FPM test for IPv4/IPv6
  ...

Conflicts:
	win32/build/config.w32
2014-11-18 21:18:52 +01:00
Anatol Belski
cf581178e7 fix "inconsistent dll linkage" warning caused by bison
stdlib.h might not be always using _STDLIB_H, that will move bison
to redeclare the malloc/free prototypes.
2014-10-29 15:30:00 +01:00
Anatol Belski
d9d16d2e68 fix datatype mismatch warnings 2014-10-29 15:29:59 +01:00
Anatol Belski
c00424e427 bring back all the TSRMLS_FETCH() stuff
for better comparability with the mainstream
2014-10-15 09:37:55 +02:00
Anatol Belski
d624b0d5eb Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (26 commits)
  Micro optimization
  Drop unused INIT_STRING opcode
  Drop unused RAISE_ABSTRACT_ERROR opcode
  CT substitute unqualified true/false/null in namespaces
  Fix a couple compile warnings
  fix test filename
  one more test to illustrate transfer of an arbitrary data amount throug pipes
  fix tests on linux
  better test cleanup
  Use more readable inline functions
  increase the polling period to not to break existing behaviours
  updated NEWS
  Fixed bug #51800 proc_open on Windows hangs forever
  Fixed segfault
  Set an LDAP error code when failing ldap_bind due to null bytes
  Fix segmentation fault in debug_backtrace()
  Drop support for GMP 4.1
  Make gmp_setbit and gmp_clrbit return values consistent
  removed *.dsw and *.dsp files
  Opcache compatibility for coalesce operator
  ...
2014-10-01 01:33:46 +02:00
Anatol Belski
06d0230a0f cleanup TSRMLS_FETCH 2014-09-26 09:58:19 +02:00