Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix bug #61681: Malformed grammar

Generate T_STRING_VARNAME only if it actually is one. This is only the case
for "${varname}" and "${varname[offset]}" so we can just add a check for
} or [ after the LABEL.
  • Loading branch information...
commit b233de098daceb145b9a5009b8861ebb9df5c961 1 parent 8ac56c1
@nikic nikic authored
View
1  NEWS
@@ -10,6 +10,7 @@ PHP NEWS
- Core:
. Implemented FR #60738 (Allow 'set_error_handler' to handle NULL).
(Laruence, Nikita Popov)
+ . Fixed bug #61681 (Malformed grammar). (Nikita Popov, Etienne, Laruence).
- cURL:
. Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,
View
11 Zend/tests/bug61681.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #61681: Malformed grammar
+--FILE--
+<?php
+$la = "ooxx";
+
+echo "${substr('laruence', 0, 2)}";
+
+?>
+--EXPECT--
+ooxx
View
440 Zend/zend_language_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Thu Mar 1 21:27:30 2012 */
+/* Generated by re2c 0.13.5 on Mon Apr 9 18:25:45 2012 */
#line 1 "Zend/zend_language_scanner.l"
/*
+----------------------------------------------------------------------+
@@ -1090,7 +1090,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy3:
YYDEBUG(3, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1783 "Zend/zend_language_scanner.l"
+#line 1784 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -1168,7 +1168,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy6:
YYDEBUG(6, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1771 "Zend/zend_language_scanner.l"
+#line 1772 "Zend/zend_language_scanner.l"
{
if (CG(short_tags)) {
zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1187,7 +1187,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
if ((yych = *YYCURSOR) == '=') goto yy43;
YYDEBUG(8, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1748 "Zend/zend_language_scanner.l"
+#line 1749 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1385,7 +1385,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(38, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1708 "Zend/zend_language_scanner.l"
+#line 1709 "Zend/zend_language_scanner.l"
{
YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
@@ -1429,7 +1429,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(44, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1726 "Zend/zend_language_scanner.l"
+#line 1727 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1447,7 +1447,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(46, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1739 "Zend/zend_language_scanner.l"
+#line 1740 "Zend/zend_language_scanner.l"
{
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
@@ -1482,7 +1482,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy51:
YYDEBUG(51, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1761 "Zend/zend_language_scanner.l"
+#line 1762 "Zend/zend_language_scanner.l"
{
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
@@ -1562,7 +1562,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy56:
YYDEBUG(56, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2234 "Zend/zend_language_scanner.l"
+#line 2235 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -1614,7 +1614,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(59, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2178 "Zend/zend_language_scanner.l"
+#line 2179 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return '`';
@@ -1629,7 +1629,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(62, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2165 "Zend/zend_language_scanner.l"
+#line 2166 "Zend/zend_language_scanner.l"
{
zendlval->value.lval = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
@@ -1652,7 +1652,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy65:
YYDEBUG(65, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1865 "Zend/zend_language_scanner.l"
+#line 1866 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
@@ -1683,7 +1683,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(71, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1857 "Zend/zend_language_scanner.l"
+#line 1858 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -1709,7 +1709,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(74, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1847 "Zend/zend_language_scanner.l"
+#line 1848 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -1785,7 +1785,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy78:
YYDEBUG(78, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2184 "Zend/zend_language_scanner.l"
+#line 2185 "Zend/zend_language_scanner.l"
{
if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
@@ -1845,7 +1845,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(81, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2173 "Zend/zend_language_scanner.l"
+#line 2174 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return '"';
@@ -1860,7 +1860,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(84, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2165 "Zend/zend_language_scanner.l"
+#line 2166 "Zend/zend_language_scanner.l"
{
zendlval->value.lval = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
@@ -1883,7 +1883,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy87:
YYDEBUG(87, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1865 "Zend/zend_language_scanner.l"
+#line 1866 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
@@ -1914,7 +1914,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(93, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1857 "Zend/zend_language_scanner.l"
+#line 1858 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -1940,7 +1940,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(96, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1847 "Zend/zend_language_scanner.l"
+#line 1848 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -1959,7 +1959,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(100, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2152 "Zend/zend_language_scanner.l"
+#line 2153 "Zend/zend_language_scanner.l"
{
YYCURSOR += CG(heredoc_len) - 1;
yyleng = CG(heredoc_len);
@@ -2033,7 +2033,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy104:
YYDEBUG(104, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2276 "Zend/zend_language_scanner.l"
+#line 2277 "Zend/zend_language_scanner.l"
{
int newline = 0;
@@ -2119,7 +2119,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(108, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2165 "Zend/zend_language_scanner.l"
+#line 2166 "Zend/zend_language_scanner.l"
{
zendlval->value.lval = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
@@ -2142,7 +2142,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy111:
YYDEBUG(111, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1865 "Zend/zend_language_scanner.l"
+#line 1866 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
@@ -2173,7 +2173,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(117, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1857 "Zend/zend_language_scanner.l"
+#line 1858 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -2199,7 +2199,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(120, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1847 "Zend/zend_language_scanner.l"
+#line 1848 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -2388,7 +2388,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy124:
YYDEBUG(124, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1888 "Zend/zend_language_scanner.l"
+#line 1889 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, yytext, yyleng);
zendlval->type = IS_STRING;
@@ -2931,7 +2931,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy172:
YYDEBUG(172, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1498 "Zend/zend_language_scanner.l"
+#line 1499 "Zend/zend_language_scanner.l"
{
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
zendlval->value.lval = strtol(yytext, NULL, 0);
@@ -2980,7 +2980,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy176:
YYDEBUG(176, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1895 "Zend/zend_language_scanner.l"
+#line 1896 "Zend/zend_language_scanner.l"
{
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
@@ -3021,7 +3021,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy178:
YYDEBUG(178, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1986 "Zend/zend_language_scanner.l"
+#line 1987 "Zend/zend_language_scanner.l"
{
register char *s, *t;
char *end;
@@ -3096,7 +3096,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy180:
YYDEBUG(180, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2055 "Zend/zend_language_scanner.l"
+#line 2056 "Zend/zend_language_scanner.l"
{
int bprefix = (yytext[0] != '"') ? 1 : 0;
@@ -3143,7 +3143,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(182, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2146 "Zend/zend_language_scanner.l"
+#line 2147 "Zend/zend_language_scanner.l"
{
BEGIN(ST_BACKQUOTE);
return '`';
@@ -3154,7 +3154,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(184, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2404 "Zend/zend_language_scanner.l"
+#line 2405 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -3190,7 +3190,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy189:
YYDEBUG(189, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1563 "Zend/zend_language_scanner.l"
+#line 1564 "Zend/zend_language_scanner.l"
{
zendlval->value.dval = zend_strtod(yytext, NULL);
zendlval->type = IS_DOUBLE;
@@ -3288,7 +3288,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
YYDEBUG(201, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1473 "Zend/zend_language_scanner.l"
+#line 1474 "Zend/zend_language_scanner.l"
{
char *bin = yytext + 2; /* Skip "0b" */
int len = yyleng - 2;
@@ -3325,7 +3325,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
YYDEBUG(204, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1519 "Zend/zend_language_scanner.l"
+#line 1520 "Zend/zend_language_scanner.l"
{
char *hex = yytext + 2; /* Skip "0x" */
int len = yyleng - 2;
@@ -3359,7 +3359,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy206:
YYDEBUG(206, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1963 "Zend/zend_language_scanner.l"
+#line 1964 "Zend/zend_language_scanner.l"
{
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
@@ -3401,7 +3401,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy211:
YYDEBUG(211, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1865 "Zend/zend_language_scanner.l"
+#line 1866 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
@@ -3497,7 +3497,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy228:
YYDEBUG(228, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1972 "Zend/zend_language_scanner.l"
+#line 1973 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
BEGIN(INITIAL);
@@ -3564,7 +3564,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy238:
YYDEBUG(238, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1929 "Zend/zend_language_scanner.l"
+#line 1930 "Zend/zend_language_scanner.l"
{
int doc_com;
@@ -3872,7 +3872,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
yy279:
YYDEBUG(279, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2097 "Zend/zend_language_scanner.l"
+#line 2098 "Zend/zend_language_scanner.l"
{
char *s;
int bprefix = (yytext[0] != '<') ? 1 : 0;
@@ -4168,7 +4168,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
YYDEBUG(319, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1698 "Zend/zend_language_scanner.l"
+#line 1699 "Zend/zend_language_scanner.l"
{
if (CG(current_namespace)) {
*zendlval = *CG(current_namespace);
@@ -4198,7 +4198,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
YYDEBUG(324, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1671 "Zend/zend_language_scanner.l"
+#line 1672 "Zend/zend_language_scanner.l"
{
char *filename = zend_get_compiled_filename(TSRMLS_C);
const size_t filename_len = strlen(filename);
@@ -4250,7 +4250,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
YYDEBUG(330, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1653 "Zend/zend_language_scanner.l"
+#line 1654 "Zend/zend_language_scanner.l"
{
zendlval->value.lval = CG(zend_lineno);
zendlval->type = IS_LONG;
@@ -4291,7 +4291,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
YYDEBUG(338, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1632 "Zend/zend_language_scanner.l"
+#line 1633 "Zend/zend_language_scanner.l"
{
const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
@@ -4363,7 +4363,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
YYDEBUG(349, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1616 "Zend/zend_language_scanner.l"
+#line 1617 "Zend/zend_language_scanner.l"
{
const char *func_name = NULL;
@@ -4399,7 +4399,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
YYDEBUG(354, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1659 "Zend/zend_language_scanner.l"
+#line 1660 "Zend/zend_language_scanner.l"
{
char *filename = zend_get_compiled_filename(TSRMLS_C);
@@ -4441,7 +4441,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
YYDEBUG(361, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1596 "Zend/zend_language_scanner.l"
+#line 1597 "Zend/zend_language_scanner.l"
{
const char *trait_name = NULL;
@@ -4491,7 +4491,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
YYDEBUG(368, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1569 "Zend/zend_language_scanner.l"
+#line 1570 "Zend/zend_language_scanner.l"
{
const char *class_name = NULL;
@@ -7359,56 +7359,80 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
yy808:
YYDEBUG(808, *YYCURSOR);
- ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy813;
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '_') {
+ if (yych <= '@') {
+ if (yych <= '/') goto yy809;
+ if (yych <= '9') goto yy812;
+ } else {
+ if (yych <= '[') goto yy812;
+ if (yych >= '_') goto yy812;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '`') goto yy809;
+ if (yych <= 'z') goto yy812;
+ } else {
+ if (yych != '~') goto yy812;
+ }
+ }
yy809:
YYDEBUG(809, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1457 "Zend/zend_language_scanner.l"
+#line 1467 "Zend/zend_language_scanner.l"
{
- zend_copy_value(zendlval, yytext, yyleng);
- zendlval->type = IS_STRING;
+ yyless(0);
yy_pop_state(TSRMLS_C);
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
- return T_STRING_VARNAME;
+ goto restart;
}
-#line 7377 "Zend/zend_language_scanner.c"
+#line 7391 "Zend/zend_language_scanner.c"
yy810:
YYDEBUG(810, *YYCURSOR);
- ++YYCURSOR;
+ yych = *++YYCURSOR;
+ goto yy809;
+yy811:
YYDEBUG(811, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1466 "Zend/zend_language_scanner.l"
- {
- yyless(0);
- yy_pop_state(TSRMLS_C);
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
- goto restart;
-}
-#line 7390 "Zend/zend_language_scanner.c"
-yy812:
- YYDEBUG(812, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy813:
- YYDEBUG(813, *YYCURSOR);
+yy812:
+ YYDEBUG(812, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy812;
+ goto yy811;
}
+ if (yych == '[') goto yy814;
+ if (yych == '}') goto yy814;
+ YYDEBUG(813, *YYCURSOR);
+ YYCURSOR = YYMARKER;
goto yy809;
+yy814:
+ YYDEBUG(814, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(815, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1457 "Zend/zend_language_scanner.l"
+ {
+ yyless(yyleng - 1);
+ zend_copy_value(zendlval, yytext, yyleng);
+ zendlval->type = IS_STRING;
+ yy_pop_state(TSRMLS_C);
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ return T_STRING_VARNAME;
+}
+#line 7425 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_NOWDOC:
- YYDEBUG(814, *YYCURSOR);
+ YYDEBUG(816, *YYCURSOR);
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(816, *YYCURSOR);
+ YYDEBUG(818, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(817, *YYCURSOR);
+ YYDEBUG(819, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2348 "Zend/zend_language_scanner.l"
+#line 2349 "Zend/zend_language_scanner.l"
{
int newline = 0;
@@ -7463,7 +7487,7 @@ int lex_scan(zval *zendlval TSRMLS_DC)
HANDLE_NEWLINES(yytext, yyleng - newline);
return T_ENCAPSED_AND_WHITESPACE;
}
-#line 7467 "Zend/zend_language_scanner.c"
+#line 7491 "Zend/zend_language_scanner.c"
/* *********************************** */
yyc_ST_VAR_OFFSET:
{
@@ -7501,76 +7525,76 @@ int lex_scan(zval *zendlval TSRMLS_DC)
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
};
- YYDEBUG(818, *YYCURSOR);
+ YYDEBUG(820, *YYCURSOR);
YYFILL(3);
yych = *YYCURSOR;
if (yych <= '/') {
if (yych <= ' ') {
if (yych <= '\f') {
- if (yych <= 0x08) goto yy832;
- if (yych <= '\n') goto yy828;
- goto yy832;
+ if (yych <= 0x08) goto yy834;
+ if (yych <= '\n') goto yy830;
+ goto yy834;
} else {
- if (yych <= '\r') goto yy828;
- if (yych <= 0x1F) goto yy832;
- goto yy828;
+ if (yych <= '\r') goto yy830;
+ if (yych <= 0x1F) goto yy834;
+ goto yy830;
}
} else {
if (yych <= '$') {
- if (yych <= '"') goto yy827;
- if (yych <= '#') goto yy828;
- goto yy823;
+ if (yych <= '"') goto yy829;
+ if (yych <= '#') goto yy830;
+ goto yy825;
} else {
- if (yych == '\'') goto yy828;
- goto yy827;
+ if (yych == '\'') goto yy830;
+ goto yy829;
}
}
} else {
if (yych <= '\\') {
if (yych <= '@') {
- if (yych <= '0') goto yy820;
- if (yych <= '9') goto yy822;
- goto yy827;
+ if (yych <= '0') goto yy822;
+ if (yych <= '9') goto yy824;
+ goto yy829;
} else {
- if (yych <= 'Z') goto yy830;
- if (yych <= '[') goto yy827;
- goto yy828;
+ if (yych <= 'Z') goto yy832;
+ if (yych <= '[') goto yy829;
+ goto yy830;
}
} else {
if (yych <= '_') {
- if (yych <= ']') goto yy825;
- if (yych <= '^') goto yy827;
- goto yy830;
+ if (yych <= ']') goto yy827;
+ if (yych <= '^') goto yy829;
+ goto yy832;
} else {
- if (yych <= '`') goto yy827;
- if (yych <= 'z') goto yy830;
- if (yych <= '~') goto yy827;
- goto yy830;
+ if (yych <= '`') goto yy829;
+ if (yych <= 'z') goto yy832;
+ if (yych <= '~') goto yy829;
+ goto yy832;
}
}
}
-yy820:
- YYDEBUG(820, *YYCURSOR);
+yy822:
+ YYDEBUG(822, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 'W') {
if (yych <= '9') {
- if (yych >= '0') goto yy844;
+ if (yych >= '0') goto yy846;
} else {
- if (yych == 'B') goto yy841;
+ if (yych == 'B') goto yy843;
}
} else {
if (yych <= 'b') {
- if (yych <= 'X') goto yy843;
- if (yych >= 'b') goto yy841;
+ if (yych <= 'X') goto yy845;
+ if (yych >= 'b') goto yy843;
} else {
- if (yych == 'x') goto yy843;
+ if (yych == 'x') goto yy845;
}
}
-yy821:
- YYDEBUG(821, *YYCURSOR);
+yy823:
+ YYDEBUG(823, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1544 "Zend/zend_language_scanner.l"
+#line 1545 "Zend/zend_language_scanner.l"
{ /* Offset could be treated as a long */
if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) {
zendlval->value.lval = strtol(yytext, NULL, 10);
@@ -7582,81 +7606,81 @@ int lex_scan(zval *zendlval TSRMLS_DC)
}
return T_NUM_STRING;
}
-#line 7586 "Zend/zend_language_scanner.c"
-yy822:
- YYDEBUG(822, *YYCURSOR);
+#line 7610 "Zend/zend_language_scanner.c"
+yy824:
+ YYDEBUG(824, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy840;
-yy823:
- YYDEBUG(823, *YYCURSOR);
+ goto yy842;
+yy825:
+ YYDEBUG(825, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '_') {
- if (yych <= '@') goto yy824;
- if (yych <= 'Z') goto yy836;
- if (yych >= '_') goto yy836;
+ if (yych <= '@') goto yy826;
+ if (yych <= 'Z') goto yy838;
+ if (yych >= '_') goto yy838;
} else {
- if (yych <= '`') goto yy824;
- if (yych <= 'z') goto yy836;
- if (yych >= 0x7F) goto yy836;
+ if (yych <= '`') goto yy826;
+ if (yych <= 'z') goto yy838;
+ if (yych >= 0x7F) goto yy838;
}
-yy824:
- YYDEBUG(824, *YYCURSOR);
+yy826:
+ YYDEBUG(826, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1876 "Zend/zend_language_scanner.l"
+#line 1877 "Zend/zend_language_scanner.l"
{
/* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */
return yytext[0];
}
-#line 7611 "Zend/zend_language_scanner.c"
-yy825:
- YYDEBUG(825, *YYCURSOR);
+#line 7635 "Zend/zend_language_scanner.c"
+yy827:
+ YYDEBUG(827, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(826, *YYCURSOR);
+ YYDEBUG(828, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1871 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
{
yy_pop_state(TSRMLS_C);
return ']';
}
-#line 7622 "Zend/zend_language_scanner.c"
-yy827:
- YYDEBUG(827, *YYCURSOR);
+#line 7646 "Zend/zend_language_scanner.c"
+yy829:
+ YYDEBUG(829, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy824;
-yy828:
- YYDEBUG(828, *YYCURSOR);
+ goto yy826;
+yy830:
+ YYDEBUG(830, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(829, *YYCURSOR);
+ YYDEBUG(831, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1881 "Zend/zend_language_scanner.l"
+#line 1882 "Zend/zend_language_scanner.l"
{
/* Invalid rule to return a more explicit parse error with proper line number */
yyless(0);
yy_pop_state(TSRMLS_C);
return T_ENCAPSED_AND_WHITESPACE;
}
-#line 7639 "Zend/zend_language_scanner.c"
-yy830:
- YYDEBUG(830, *YYCURSOR);
+#line 7663 "Zend/zend_language_scanner.c"
+yy832:
+ YYDEBUG(832, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy835;
-yy831:
- YYDEBUG(831, *YYCURSOR);
+ goto yy837;
+yy833:
+ YYDEBUG(833, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1888 "Zend/zend_language_scanner.l"
+#line 1889 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, yytext, yyleng);
zendlval->type = IS_STRING;
return T_STRING;
}
-#line 7654 "Zend/zend_language_scanner.c"
-yy832:
- YYDEBUG(832, *YYCURSOR);
+#line 7678 "Zend/zend_language_scanner.c"
+yy834:
+ YYDEBUG(834, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(833, *YYCURSOR);
+ YYDEBUG(835, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2404 "Zend/zend_language_scanner.l"
+#line 2405 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -7665,118 +7689,118 @@ int lex_scan(zval *zendlval TSRMLS_DC)
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
goto restart;
}
-#line 7669 "Zend/zend_language_scanner.c"
-yy834:
- YYDEBUG(834, *YYCURSOR);
+#line 7693 "Zend/zend_language_scanner.c"
+yy836:
+ YYDEBUG(836, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy835:
- YYDEBUG(835, *YYCURSOR);
+yy837:
+ YYDEBUG(837, *YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy834;
+ goto yy836;
}
- goto yy831;
-yy836:
- YYDEBUG(836, *YYCURSOR);
+ goto yy833;
+yy838:
+ YYDEBUG(838, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(837, *YYCURSOR);
+ YYDEBUG(839, *YYCURSOR);
if (yych <= '^') {
if (yych <= '9') {
- if (yych >= '0') goto yy836;
+ if (yych >= '0') goto yy838;
} else {
- if (yych <= '@') goto yy838;
- if (yych <= 'Z') goto yy836;
+ if (yych <= '@') goto yy840;
+ if (yych <= 'Z') goto yy838;
}
} else {
if (yych <= '`') {
- if (yych <= '_') goto yy836;
+ if (yych <= '_') goto yy838;
} else {
- if (yych <= 'z') goto yy836;
- if (yych >= 0x7F) goto yy836;
+ if (yych <= 'z') goto yy838;
+ if (yych >= 0x7F) goto yy838;
}
}
-yy838:
- YYDEBUG(838, *YYCURSOR);
+yy840:
+ YYDEBUG(840, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1865 "Zend/zend_language_scanner.l"
+#line 1866 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
-#line 7711 "Zend/zend_language_scanner.c"
-yy839:
- YYDEBUG(839, *YYCURSOR);
+#line 7735 "Zend/zend_language_scanner.c"
+yy841:
+ YYDEBUG(841, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy840:
- YYDEBUG(840, *YYCURSOR);
+yy842:
+ YYDEBUG(842, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy839;
+ goto yy841;
}
- goto yy821;
-yy841:
- YYDEBUG(841, *YYCURSOR);
+ goto yy823;
+yy843:
+ YYDEBUG(843, *YYCURSOR);
yych = *++YYCURSOR;
if (yybm[0+yych] & 128) {
- goto yy849;
+ goto yy851;
}
-yy842:
- YYDEBUG(842, *YYCURSOR);
+yy844:
+ YYDEBUG(844, *YYCURSOR);
YYCURSOR = YYMARKER;
- goto yy821;
-yy843:
- YYDEBUG(843, *YYCURSOR);
+ goto yy823;
+yy845:
+ YYDEBUG(845, *YYCURSOR);
yych = *++YYCURSOR;
if (yybm[0+yych] & 64) {
- goto yy847;
+ goto yy849;
}
- goto yy842;
-yy844:
- YYDEBUG(844, *YYCURSOR);
+ goto yy844;
+yy846:
+ YYDEBUG(846, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(845, *YYCURSOR);
- if (yych <= '/') goto yy846;
- if (yych <= '9') goto yy844;
-yy846:
- YYDEBUG(846, *YYCURSOR);
+ YYDEBUG(847, *YYCURSOR);
+ if (yych <= '/') goto yy848;
+ if (yych <= '9') goto yy846;
+yy848:
+ YYDEBUG(848, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1556 "Zend/zend_language_scanner.l"
+#line 1557 "Zend/zend_language_scanner.l"
{ /* Offset must be treated as a string */
zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
return T_NUM_STRING;
}
-#line 7758 "Zend/zend_language_scanner.c"
-yy847:
- YYDEBUG(847, *YYCURSOR);
+#line 7782 "Zend/zend_language_scanner.c"
+yy849:
+ YYDEBUG(849, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(848, *YYCURSOR);
+ YYDEBUG(850, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy847;
+ goto yy849;
}
- goto yy846;
-yy849:
- YYDEBUG(849, *YYCURSOR);
+ goto yy848;
+yy851:
+ YYDEBUG(851, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(850, *YYCURSOR);
+ YYDEBUG(852, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy849;
+ goto yy851;
}
- goto yy846;
+ goto yy848;
}
}
-#line 2413 "Zend/zend_language_scanner.l"
+#line 2414 "Zend/zend_language_scanner.l"
}
View
3  Zend/zend_language_scanner.l
@@ -1454,7 +1454,8 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
-<ST_LOOKING_FOR_VARNAME>{LABEL} {
+<ST_LOOKING_FOR_VARNAME>{LABEL}[[}] {
+ yyless(yyleng - 1);
zend_copy_value(zendlval, yytext, yyleng);
zendlval->type = IS_STRING;
yy_pop_state(TSRMLS_C);
View
2  Zend/zend_language_scanner_defs.h
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Thu Mar 1 21:27:30 2012 */
+/* Generated by re2c 0.13.5 on Mon Apr 9 18:25:45 2012 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
Please sign in to comment.
Something went wrong with that request. Please try again.