summaryrefslogtreecommitdiff
path: root/Zend/zend_language_parser.y
Commit message (Collapse)AuthorAgeFilesLines
* Use "%define parse.error verbose"Akim Demaille2020-01-291-1/+2
| | | | | | | | | | | The YYERROR_VERBOSE macro will no longer be supported in Bison 3.6. It was superseded by the "%error-verbose" directive in Bison 1.875 (2003-01-01). Bison 2.6 (2012-07-19) clearly announced that support for YYERROR_VERBOSE would be removed. Note that since Bison 3.0 (2013-07-25), "%error-verbose" is deprecated in favor of "%define parse.error verbose". Closes GH-5125.
* new_variable '{' expr '}' is deprecated as wellChristoph M. Becker2019-09-091-1/+1
| | | | | | | | | | Curly brace syntax for accessing array elements and string offsets is deprecated [1]; this should also be the case for respective `new` expressions. This issue has been reported by brzuchal@php.net. [1] <https://wiki.php.net/rfc/deprecate_curly_braces_array_access>
* Don't specify precedence for T_INC/T_DECNikita Popov2019-08-271-3/+3
| | | | | As these do not operate on expressions, precedence is meaningless for them.
* Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-08-021-1/+1
|\
| * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-08-021-1/+1
| |\
| | * Fixed bug #78363Nikita Popov2019-08-021-1/+1
| | |
| | * year++Xinchen Hui2018-01-021-1/+1
| | |
| * | Future-proof email addressesZeev Suraski2018-11-011-2/+2
| | |
* | | Deprecate alternative array access syntaxrjhdby2019-07-191-1/+1
| | | | | | | | | | | | RFC: https://wiki.php.net/rfc/deprecate_curly_braces_array_access
* | | Emit T_BAD_CHARACTER for unexpected charactersNikita Popov2019-07-151-0/+1
| | | | | | | | | | | | | | | Avoid having holes in the token stream which are annoying and inefficient to reconstruct on the consumer side.
* | | Replace ZEND_ASSIGN_ADD (and others) by ZEND_ASSIGN_OP, ZEND_ASSIGN_DIM_OP, ↵Dmitry Stogov2019-07-051-12/+12
| | | | | | | | | | | | ZEND_ASSGIN_OBJ_OP and ZEND_ASSIGN_STATIC_PROP_OP
* | | Use %define api.pure instead of %pure-parserNikita Popov2019-06-121-1/+1
| | | | | | | | | | | | | | | %pure-parser is deprecated. In our case there is no difference between true & full, as we don't use locations.
* | | Merge branch 'deprecate_concat_add_sub' into PHP-8.4Bob Weinand2019-05-161-0/+1
|\ \ \
| * | | Deprecate unparenthesized concatenation and addition/subtractionBob Weinand2019-03-281-1/+1
| | | | | | | | | | | | | | | | Implementing RFC https://wiki.php.net/rfc/concatenation_precedence
* | | | Implement spread operator in arraysCHU Zhaowei2019-05-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/spread_operator_for_array Closes GH-3640.
* | | | Deprecate left-associative ternaryNikita Popov2019-05-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Deprecate nesting ternary operators without explicit parentheses. RFC: https://wiki.php.net/rfc/ternary_associativity
* | | | Implement arrow functionsNikita Popov2019-05-021-10/+29
|/ / / | | | | | | | | | | | | | | | | | | Per RFC: https://wiki.php.net/rfc/arrow_functions_v2 Co-authored-by: Levi Morrison <levim@php.net> Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
* | | Revert "Switch to bison location tracking"Nikita Popov2019-03-281-287/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e528762c1c59bc0bd0bd6d78246c14269630cf0f. Dmitry reports that this has a non-trivial impact on parsing overhead, especially on 32-bit systems. As we don't have a strong need for this change right now, I'm reverting it. See also comments on https://github.com/php/php-src/commit/e528762c1c59bc0bd0bd6d78246c14269630cf0f.
* | | Switch to bison location trackingNikita Popov2019-03-211-267/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Locations for AST nodes are now tracked with the help of bison location tracking. This is more accurate than what we currently do and easier to extend with more information. A zend_ast_loc structure is introduced, which is used for the location stack. Currently it only holds the start lineno, but can be extended to also hold end lineno and offset/column information in the future. All AST constructors now accept a zend_ast_loc* as first argument, and will use it to determine their lineno. Previously this used either the CG(zend_lineno), or the smallest AST lineno of child nodes. On the parser side, the location structure for a whole rule can be obtained using the &@$ character salad.
* | | Remove unnecessary precedence/associativity annotationsNikita Popov2019-03-151-17/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of these are entirely unnecessary. Some specify an associativity for operators where the concept doesn't make sense and has no effect: Explicit associativity is only meaningful for binary operators. For unary operators and constrained operations like instanceof or assignment the associativity specification has no effect and only serves to confuse. For example assignments were specified as %left, even though they will actually behave as right-associative due to the variable requirement on the LHS. Similarly instanceof was specified as %nonassoc, but it will behave as left-associative, due to the restrictions places on the RHS.
* | | Remove local variablesPeter Kokot2019-02-031-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | | Adios, yearly copyright rangesZeev Suraski2019-01-301-1/+1
| | |
* | | Implement ??= operatorNikita Popov2019-01-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/null_coalesce_equal_operator $a ??= $b is $a ?? ($a = $b), with the difference that $a is only evaluated once, to the degree that this is possible. In particular in $a[foo()] ?? $b function foo() is only ever called once. However, the variable access themselves will be reevaluated.
* | | Implement typed propertiesNikita Popov2019-01-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/typed_properties_v2 This is a squash of PR #3734, which is a squash of PR #3313. Co-authored-by: Bob Weinand <bobwei9@hotmail.com> Co-authored-by: Joe Watkins <krakjoe@php.net> Co-authored-by: Dmitry Stogov <dmitry@zend.com>
* | | Introduce separate ZEND_AST_CLASS_NAME AST nodeNikita Popov2019-01-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Instead of representing this as a ZEND_AST_CLASS_CONST with a "class" constant name. Class constants and ::class are unrelated features that happen to share syntax, so represent and handle them separately.
* | | Update email addresses. We're still @Zend, but future proofing it...Zeev Suraski2018-11-011-2/+2
|/ /
* | Avoid hash lookups in BIND_STATIC and BIND_LEXICAL opcode handlers.Dmitry Stogov2018-08-201-1/+1
| | | | | | | | Encode static variable offset into opline->extended_value.
* | Remove unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* | Remove expr_without_variableNikita Popov2018-06-241-8/+5
| | | | | | | | We no longer need this distinction.
* | Fixed bug #75218Nikita Popov2018-06-161-5/+7
| | | | | | | | | | | | | | | | | | | | | | I've introduced a new CompileError type, from which ParseError inherits. These errors are not parse errors in the narrow sense of the term, even though they happen to be generated during parsing in our implementation. Additionally reusing the ParseError class for this purpose would change existing error messages (if the exception is not caught) from a "Fatal error:" to a "Parse error:" prefix, and also the error kind from E_COMPILE_ERROR to E_PARSE.
* | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-1/+1
| | | | | | | | where we sure about string persistence.
* | Use cheaper functionsDmitry Stogov2018-03-151-2/+2
| |
* | Revert "Handle scanner error in first place (don't hide them from ↵Dmitry Stogov2018-03-141-8/+6
| | | | | | | | | | | | ext/tokenizer) and cheaper whitespace handlig." This reverts commit 0d6da03f5c3e49b92cf6817ba8a7f8d6f60ee1aa.
* | Handle scanner error in first place (don't hide them from ext/tokenizer) and ↵Dmitry Stogov2018-03-131-6/+8
| | | | | | | | cheaper whitespace handlig.
* | year++Xinchen Hui2018-01-021-1/+1
| |
* | Allow trailing commas in function and method callsSammy Kaye Powers2017-11-061-3/+3
|/
* further sync for vim mode linesAnatol Belski2017-07-041-0/+2
|
* Add trailing comma syntax support for mixed and unmixed group use listsSammy Kaye Powers2017-05-011-4/+9
| | | | RFC: https://wiki.php.net/rfc/list-syntax-trailing-commas
* Interned strings unification for TS/NTSAnatol Belski2017-03-041-1/+1
| | | | | | | | | | | | | Hereby, interned strings are supported in thread safe PHP. The patch implements two types of interned strings - interning per process, strings are not freed till process end - interning per request, strings are freed at request end There is no runtime interning. With Opcache, all the permanent iterned strings are copied into SHM on startup, additional copying into SHM might happen on demand.
* Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
|
* Merge branch 'PHP-7.1'Nikita Popov2016-12-111-4/+4
|\
| * Fix T_NUM_STRING negationNikita Popov2016-12-111-4/+4
| | | | | | | | | | | | | | T_NUM_STRING follows the rules of symtable numeric string conversion. If the offset isn't an integer under those rules, it is treated as a string. This should apply to negated T_NUM_STRINGs as well.
* | Merge branch 'PHP-7.1'Christoph M. Becker2016-10-141-0/+1
|\ \ | |/
| * Implement #72918: negative offset inside a quoted string leads to parse errorChristoph M. Becker2016-10-141-0/+1
| | | | | | | | | | We allow negative numeric offsets for the simple syntax inside double-quoted and heredoc strings.
* | Fix "already in use" check inconsistencies/bugsNikita Popov2016-10-071-4/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following issues: * "use function" and "use const" inside namespaced code were checking for conflicts against class imports. Now they always check against the correct symbol type. * Symbol conflicts are now always checked within a single file only. Previously class uses inside namespaced code were checked globally. This behavior is illegal because symbols from other files are not visible if opcache is used, resulting in behavioral discrepancies. Additionally this made the presence/absence of symbol errors dependent on autoloading order, which is volatile. * The "single file" restriction is now enforced by collecting defined symbols inside a separate hash table. Previously it was enforced (for the non-namespaced case) by comparing the filename of the symbol declaration. However this is inaccurate if the same filename is used multiple times, such as may happen if eval() is used. * Additionally the previous approach relies on symbols being registered at compile-time, which is not the case for late-bound classes, which makes the behavior dependent on class declaration order, as well as opcache (which may cause delayed early-binding). * Lastly, conflicts are now consistently checked for conditionally defined symbols. Previously only declaration-after-use conflicts were checked in this case. Now use-after-declaration conflicts are detected as well.
* Use non-deprecated %pure-parserDavey Shafik2016-08-111-1/+1
|
* Forbid use of array() in nested destructuringNikita Popov2016-07-061-8/+10
| | | | Previously array() was only forbidden on the outermost level.
* Improve the signatureXinchen Hui2016-06-141-1/+2
|
* CleanupXinchen Hui2016-06-131-1/+1
|
* Fixed bug #72395 (list() regression)Xinchen Hui2016-06-131-11/+9
|