mirror of
https://github.com/php/php-src.git
synced 2025-01-02 08:54:04 +08:00
backport the yyless patch from 5.3 branch. it seems I forgot to commit this..
# you'll probably need re2c 0.13.5 or newer to regenerate this file # Matt: please advise if there's still somrthing pending (i.e. was the heredoc/nowdoc patch MFB already?
This commit is contained in:
parent
ec965d1531
commit
1c5df1565f
File diff suppressed because it is too large
Load Diff
@ -63,7 +63,8 @@
|
||||
#define YYSTATE YYGETCONDITION()
|
||||
#define yytext ((char*)SCNG(yy_text))
|
||||
#define yyleng SCNG(yy_leng)
|
||||
#define yyless(x) YYCURSOR = yytext + x
|
||||
#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + (x); \
|
||||
yyleng = (unsigned int)(x); } while(0)
|
||||
#define yymore() goto yymore_restart
|
||||
|
||||
/* perform sanity check. If this message is triggered you should
|
||||
@ -2197,8 +2198,7 @@ inline_char_handler:
|
||||
* and "->" will be taken literally
|
||||
*/
|
||||
<ST_DOUBLE_QUOTES,ST_HEREDOC,ST_BACKQUOTE>"$"{LABEL}"->"[a-zA-Z_\x7f-\xff] {
|
||||
yyleng -= 3;
|
||||
yyless(yyleng);
|
||||
yyless(yyleng - 3);
|
||||
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
|
||||
|
||||
if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
|
||||
@ -2213,8 +2213,7 @@ inline_char_handler:
|
||||
/* A [ always designates a variable offset, regardless of what follows
|
||||
*/
|
||||
<ST_DOUBLE_QUOTES,ST_HEREDOC,ST_BACKQUOTE>"$"{LABEL}"[" {
|
||||
yyleng--;
|
||||
yyless(yyleng);
|
||||
yyless(yyleng - 1);
|
||||
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
|
||||
|
||||
if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
|
||||
@ -2249,7 +2248,6 @@ inline_char_handler:
|
||||
<ST_VAR_OFFSET>[ \n\r\t\\'#] {
|
||||
/* Invalid rule to return a more explicit parse error with proper line number */
|
||||
yyless(0);
|
||||
yyleng = 0;
|
||||
yy_pop_state(TSRMLS_C);
|
||||
ZVAL_EMPTY_TEXT(zendlval); /* Empty since it won't be used */
|
||||
return T_ENCAPSED_AND_WHITESPACE;
|
||||
@ -2314,8 +2312,7 @@ inline_char_handler:
|
||||
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
|
||||
Z_STRLEN_P(zendlval) = yyleng-2;
|
||||
Z_TYPE_P(zendlval) = IS_STRING;
|
||||
yyleng -= 2;
|
||||
yyless(yyleng);
|
||||
yyless(yyleng - 2);
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
return T_COMMENT;
|
||||
} else {
|
||||
@ -2380,7 +2377,6 @@ inline_char_handler:
|
||||
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
|
||||
} else {
|
||||
yyless(1);
|
||||
yyleng = 1;
|
||||
return yytext[0];
|
||||
}
|
||||
}
|
||||
@ -2492,7 +2488,6 @@ inline_char_handler:
|
||||
}
|
||||
|
||||
yyless(label_len);
|
||||
yyleng = label_len;
|
||||
|
||||
if (label_len==CG(heredoc_len) && !memcmp(yytext, CG(heredoc), label_len)) {
|
||||
Z_STRVAL_P(zendlval) = CG(heredoc);
|
||||
@ -2589,11 +2584,10 @@ inline_char_handler:
|
||||
* (("{"+|"$"+)["]) handles { or $ at the end of a string
|
||||
*
|
||||
* Same for backquotes and heredocs, except the second case doesn't apply to
|
||||
* heredocs. yyleng--/yyless() is used to correct taking one character too many
|
||||
* heredocs. yyless(yyleng - 1) is used to correct taking one character too many
|
||||
*/
|
||||
<ST_DOUBLE_QUOTES>{DOUBLE_QUOTES_CHARS}*("{"{2,}|"$"{2,}|(("{"+|"$"+)["])) {
|
||||
yyleng--;
|
||||
yyless(yyleng);
|
||||
yyless(yyleng - 1);
|
||||
|
||||
if (CG(literal_type) == IS_UNICODE) {
|
||||
return zend_scan_unicode_escape_string(zendlval, yytext, yyleng, 0x22 /*'"'*/, T_ENCAPSED_AND_WHITESPACE TSRMLS_CC);
|
||||
@ -2614,8 +2608,7 @@ inline_char_handler:
|
||||
}
|
||||
|
||||
<ST_BACKQUOTE>{BACKQUOTE_CHARS}*("{"{2,}|"$"{2,}|(("{"+|"$"+)[`])) {
|
||||
yyleng--;
|
||||
yyless(yyleng);
|
||||
yyless(yyleng - 1);
|
||||
|
||||
if (CG(literal_type) == IS_UNICODE) {
|
||||
return zend_scan_unicode_escape_string(zendlval, yytext, yyleng, 0x60 /*'`'*/, T_ENCAPSED_AND_WHITESPACE TSRMLS_CC);
|
||||
@ -2643,8 +2636,7 @@ inline_char_handler:
|
||||
}
|
||||
|
||||
<ST_HEREDOC>{HEREDOC_CHARS}*({HEREDOC_NEWLINE}+({LABEL}";"?)?)?("{"{2,}|"$"{2,}) {
|
||||
yyleng--;
|
||||
yyless(yyleng);
|
||||
yyless(yyleng - 1);
|
||||
|
||||
if (CG(literal_type) == IS_UNICODE) {
|
||||
return zend_scan_unicode_escape_string(zendlval, yytext, yyleng, 0, T_ENCAPSED_AND_WHITESPACE TSRMLS_CC);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.4 on Sat Apr 5 19:52:57 2008 */
|
||||
/* Generated by re2c 0.13.6.dev on Fri Jun 6 18:30:48 2008 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
Loading…
Reference in New Issue
Block a user