Commit Graph

28 Commits

Author SHA1 Message Date
Xinchen Hui
4e84f72554 Fix test failed due to new Token T_YIELD 2012-09-02 13:15:23 +08:00
Nikita Popov
1823b16fa1 Merge remote-tracking branch 'php-src/master' into addGeneratorsSupport
Merging master to fix Windows build

Conflicts:
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_vm_def.h
2012-08-20 13:37:53 +02:00
Stanislav Malyshev
3336e1e78c Merge branch 'pull-request/31'
* pull-request/31:
  Fix lexing of nested heredoc strings in token_get_all()
2012-08-19 21:43:04 -07:00
Nikita Popov
99f93dd9a8 Add T_YIELD in tokenizer_data.c
Also had to fix up some tokenizer tests that were affected by the token
number changes.
2012-07-22 20:32:56 +02:00
Nikita Popov
4cf90e06c9 Fix lexing of nested heredoc strings in token_get_all()
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()).
2012-03-31 21:53:30 +02:00
Stanislav Malyshev
0d591e599f Fixed bug #54084 (token_get_all with regards to __halt_compiler is not binary safe) 2011-11-08 04:59:17 +00:00
Stefan Marr
dbc6849bca Added __TRAIT__ magic constant [TRAITS] [DOC]
# __TRAIT__ behaves like __CLASS__ more or less but is constraint to traits.
# Since traits are not types, there are not many valid use cases, and trying
# to use __TRAIT__ to make traits more like classes is discouraged.
2011-07-31 17:39:30 +00:00
Stefan Marr
03f514d0a0 Added: SKIP when tokenizer extension is not available 2011-07-31 16:35:09 +00:00
Ilia Alshanetsky
1d984a7ffd Fixed bug #54089 (token_get_all() does not stop after __halt_compiler). 2011-02-28 15:18:27 +00:00
Ilia Alshanetsky
847f519d41 Fixed tests 2010-05-24 18:52:36 +00:00
Ilia Alshanetsky
6ce4737d94 Fixed tests 2010-05-20 22:53:38 +00:00
Felipe Pena
78f43a53f7 - Fixed tests 2010-04-26 14:15:44 +00:00
Felipe Pena
b3ded59e3e - Added T_GOTO
- Fixed tests
2008-03-30 21:48:24 +00:00
Steve Seear
4c2b3336a2 Adding tokenizer test 2008-03-19 17:43:50 +00:00
Marcus Boerger
af316021e8 - Rewrite scanner to be based on re2c instead of flex
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
2008-03-16 21:06:55 +00:00
Hannes Magnusson
70b10b2b39 Fix test 2007-12-16 19:17:54 +00:00
Raghubansh Kumar
035dc8bdf6 New testcases for token_get_all() function 2007-12-14 16:21:33 +00:00
Dmitry Stogov
80d2409fd8 Improved compilation of heredocs and interpolated strings. (Matt, Dmitry) 2007-05-18 13:12:05 +00:00
Antony Dovgal
3aaf8bbdb7 fix test 2007-04-10 10:49:16 +00:00
Johannes Schlüter
8591b20d4e - MFH: Added linenumbers to array returned by token_get_all() 2007-04-08 00:18:38 +00:00
Ilia Alshanetsky
09dec62672 Fixed tokenizer tests 2006-04-20 01:06:58 +00:00
Derick Rethans
0839cadef6 - Fixed broken test case. 2006-01-04 10:31:58 +00:00
Antony Dovgal
c92ae847c7 add missing skipif conditions
fix existing ones
2005-12-21 11:42:06 +00:00
Ilia Alshanetsky
3ce27140dc Fixed bug #35655 (whitespace following end of heredoc is lost). 2005-12-13 20:55:42 +00:00
Antony Dovgal
bd8df0b32a add 2 new tests
now we have one extension absolutely covered by tests, yay! =)
2005-12-01 18:22:11 +00:00
Antony Dovgal
9c2183f622 add new test
improve gcov stats =)
2005-11-30 23:34:08 +00:00
Ilia Alshanetsky
dc9f52f039 Fix test. 2004-02-16 17:09:08 +00:00
Ilia Alshanetsky
99dec6927c Fixed bug #26463 (Incorrect handling of semicolons after heredoc) 2003-11-29 19:05:14 +00:00