summaryrefslogtreecommitdiff
path: root/Zend/zend_highlight.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Switch to bison location tracking"Nikita Popov2019-03-281-5/+3
| | | | | | | | | | | 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-3/+5
| | | | | | | | | | | | | | | | | 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 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
|
* Update email addresses. We're still @Zend, but future proofing it...Zeev Suraski2018-11-011-2/+2
|
* Sync leading and final newlines in source code filesPeter Kokot2018-10-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
* 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.
* se zval_ptr_dtor_str() instead of zend_string_release_ex(Z_STR(*), 0)Dmitry Stogov2018-07-041-2/+2
|
* Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-2/+2
| | | | where we sure about string persistence.
* PHP scanner optimizationDmitry Stogov2018-03-141-5/+3
|
* year++Xinchen Hui2018-01-021-1/+1
|
* further sync for vim mode linesAnatol Belski2017-07-041-0/+2
|
* Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
|
* Fixed bug #71806Nikita Popov2016-03-111-0/+3
|
* bump year which is missed in rev 49493a2Xinchen Hui2016-01-021-1/+1
|
* Fix bug #71086Nikita Popov2015-12-111-0/+4
|
* bump yearXinchen Hui2015-01-151-1/+1
|
* trailing whitespace removalStanislav Malyshev2015-01-101-2/+2
|
* first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-9/+9
|
* fix datatype mismatchesAnatol Belski2014-10-231-1/+1
|
* Fix zend_highlight functionality I brokeNikita Popov2014-08-271-2/+8
| | | | Magic consts are not supposed to be highlighted as keywords.
* master renames phase 1Anatol Belski2014-08-251-2/+2
|
* Merge mainstream 'master' branch into refactoringDmitry Stogov2014-04-261-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During merge I had to revert: Nikita's patch for php_splice() (it probably needs to be applyed again) Bob Weinand's patches related to constant expression handling (we need to review them carefully) I also reverted all our attempts to support sapi/phpdbg (we didn't test it anyway) Conflicts: Zend/zend.h Zend/zend_API.c Zend/zend_ast.c Zend/zend_compile.c Zend/zend_compile.h Zend/zend_constants.c Zend/zend_exceptions.c Zend/zend_execute.c Zend/zend_execute.h Zend/zend_execute_API.c Zend/zend_hash.c Zend/zend_highlight.c Zend/zend_language_parser.y Zend/zend_language_scanner.c Zend/zend_language_scanner_defs.h Zend/zend_variables.c Zend/zend_vm_def.h Zend/zend_vm_execute.h ext/date/php_date.c ext/dom/documenttype.c ext/hash/hash.c ext/iconv/iconv.c ext/mbstring/tests/zend_multibyte-10.phpt ext/mbstring/tests/zend_multibyte-11.phpt ext/mbstring/tests/zend_multibyte-12.phpt ext/mysql/php_mysql.c ext/mysqli/mysqli.c ext/mysqlnd/mysqlnd_reverse_api.c ext/mysqlnd/php_mysqlnd.c ext/opcache/ZendAccelerator.c ext/opcache/zend_accelerator_util_funcs.c ext/opcache/zend_persist.c ext/opcache/zend_persist_calc.c ext/pcre/php_pcre.c ext/pdo/pdo_dbh.c ext/pdo/pdo_stmt.c ext/pdo_pgsql/pgsql_driver.c ext/pgsql/pgsql.c ext/reflection/php_reflection.c ext/session/session.c ext/spl/spl_array.c ext/spl/spl_observer.c ext/standard/array.c ext/standard/basic_functions.c ext/standard/html.c ext/standard/mail.c ext/standard/php_array.h ext/standard/proc_open.c ext/standard/streamsfuncs.c ext/standard/user_filters.c ext/standard/var_unserializer.c ext/standard/var_unserializer.re main/php_variables.c sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_bp.c sapi/phpdbg/phpdbg_frame.c sapi/phpdbg/phpdbg_help.c sapi/phpdbg/phpdbg_list.c sapi/phpdbg/phpdbg_print.c sapi/phpdbg/phpdbg_prompt.c
| * Fix bug #66660: use str_efree instead of efree to handle interned empty ↵Ferenc Kovacs2014-04-131-1/+1
| | | | | | | | strings correctly
| * Merge branch 'PHP-5.4' into PHP-5.5Johannes Schlüter2014-02-231-1/+1
| |\
| | * Make sure value is initializedJohannes Schlüter2014-02-231-1/+1
| | |
| | * Bump yearXinchen Hui2014-01-031-1/+1
| | |
| | * Happy New YearXinchen Hui2013-01-011-1/+1
| | |
| | * - Year++Felipe Pena2012-01-011-1/+1
| | |
| | * Fixed ZE specific compile warnings (Bug #55629)Dmitry Stogov2011-09-131-9/+9
| | |
| * | Bump yearXinchen Hui2014-01-031-1/+1
| | |
* | | Changed data layout to allow more efficient operationsDmitry Stogov2014-04-021-10/+11
| | |
* | | Use better data structures (incomplete)Dmitry Stogov2014-02-101-2/+2
| | |
* | | Bump yearXinchen Hui2014-01-031-1/+1
|/ /
* | Happy New YearXinchen Hui2013-01-011-1/+1
| |
* | Fixed bug #63874 (Segfaul if php_strip_whitespace has heredoc)Pierrick Charron2012-12-291-1/+0
| | | | | | | | | | T_END_HEREDOC don't carry a token value anymore since commit 4cf90e06c Bugfix by Nikita for bug #60097
* | Fix lexing of nested heredoc strings in token_get_all()Nikita Popov2012-03-311-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bug #60097. Before two global variables CG(heredoc) and CG(heredoc_len) were used to track the current heredoc label. In order to support nested heredoc strings the *previous* heredoc label was assigned as the token value of T_START_HEREDOC and the language_parser.y assigned that to CG(heredoc). This created a dependency of the lexer on the parser. Thus the token_get_all() function, which accesses the lexer directly without also running the parser, was not able to tokenize nested heredoc strings (and leaked memory). Same applies for the source-code highlighting functions. The new approach is to maintain a heredoc_label_stack in the lexer, which contains all active heredoc labels. As it is no longer required, T_START_HEREDOC and T_END_HEREDOC now don't carry a token value anymore. In order to make the work with zend_ptr_stack in this context more convenient I added a new function zend_ptr_stack_top(), which retrieves the top element of the stack (similar to zend_stack_top()).
* | - Year++Felipe Pena2012-01-011-1/+1
| |
* | Fixed ZE specific compile warnings (Bug #55629)Dmitry Stogov2011-09-131-9/+9
|/
* - Year++Felipe Pena2011-01-011-1/+1
|
* Added multibyte suppport by default. Previosly php had to be compiled with ↵Dmitry Stogov2010-11-241-5/+0
| | | | --enable-zend-multibyte. Now it can be enabled or disabled throug zend.multibyte directive in php.ini
* - Reverted r296062 and r296065Jani Taskinen2010-03-121-23/+22
|
* MFH: Improved / fixed output buffering (Michael Wallner)Jani Taskinen2010-03-111-22/+23
|
* sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.phpSebastian Bergmann2010-01-051-1/+1
|
* MFH: Implemented manual scanning for strings/comments, plus misc. fixesMatt Wilmas2009-05-051-21/+2
|
* MFH: Bump copyright year, 3 of 3.Sebastian Bergmann2008-12-311-1/+1
|
* . Added support for using static HEREDOCs to initialize static variables and ↵Dmitry Stogov2008-07-261-17/+5
| | | | | | | | class members or constants. (Matt) . Improved syntax highlighting and consistency for variables in double-quoted strings and literal text in HEREDOCs and backticks. (Matt) . Optimized interpolated strings to use one less opcode. (Matt)
* implemented again zend-multibyte for PHP 5.3Rui Hirokawa2008-06-291-0/+17
|
* - Rewrite scanner to be based on re2c instead of flexMarcus Boerger2008-03-161-20/+2
| | | | | | | | | The full patch is available as: http://php.net/~helly/php-re2c-5.3-20080316.diff.txt This is against php-re2c repository version 98 An older patch against version 97 is available under: http://php.net/~helly/php-re2c-97-20080316.diff.txt
* Added NEWDOCDmitry Stogov2008-02-121-1/+3
|