parse opent echo tag

This commit is contained in:
z7zmey 2017-12-01 18:40:00 +02:00
parent 880749fbda
commit e7579c4e05
3 changed files with 17 additions and 5 deletions

View File

@ -14,3 +14,13 @@ abstract class Foo extends Bar implements Buz, Buzz {
}
}
if ($a === true) {
} elseif ($a === false) {
} elseif ($a === null) {
} else {
}
?>
<?= $b; $b ?>

View File

@ -7715,7 +7715,7 @@ yyrule5: // \<\?=
{
l.begin(PHP)
lval.token = string(l.TokenBytes(nil))
return T_OPEN_TAG_WITH_ECHO
return T_ECHO
goto yystate0
}
yyrule6: // [ \t\n\r]+
@ -7725,7 +7725,9 @@ yyrule6: // [ \t\n\r]+
}
yyrule7: // \?\>{NEW_LINE}?
{
l.begin(INITIAL) //lval.token = string(l.TokenBytes(nil)); return T_CLOSE_TAG;
l.begin(INITIAL)
lval.token = ";"
return rune2Class(';')
goto yystate0
}
yyrule8: // {DNUM}|{EXPONENT_DNUM}

View File

@ -96,10 +96,10 @@ NEW_LINE (\r|\n|\r\n)
<INITIAL>\<\?php([ \t]|{NEW_LINE}) l.begin(PHP);//lval.token = string(l.TokenBytes(nil)); return T_OPEN_TAG;
<INITIAL>\<\? l.begin(PHP);//lval.token = string(l.TokenBytes(nil)); return T_OPEN_TAG;
<INITIAL>\<\?= l.begin(PHP);lval.token = string(l.TokenBytes(nil)); return T_OPEN_TAG_WITH_ECHO;
<INITIAL>\<\?= l.begin(PHP);lval.token = string(l.TokenBytes(nil)); return T_ECHO;
<PHP>[ \t\n\r]+ //lval.token = string(l.TokenBytes(nil)); return T_WHITESPACE
<PHP>\?\>{NEW_LINE}? l.begin(INITIAL);//lval.token = string(l.TokenBytes(nil)); return T_CLOSE_TAG;
<PHP>\?\>{NEW_LINE}? l.begin(INITIAL);lval.token = ";"; return rune2Class(';');
<PHP>{DNUM}|{EXPONENT_DNUM} lval.token = string(l.TokenBytes(nil)); return T_DNUMBER
<PHP>{BNUM}