accept backslash newline in single quotes

fixes #57
This commit is contained in:
Imuli 2018-07-20 19:53:43 -04:00
parent 731a0ed1c4
commit 5675714af8
2 changed files with 3 additions and 3 deletions

View File

@ -777,7 +777,7 @@ yystate29:
switch {
default:
goto yyabort
case c >= '\x01' && c <= '\t' || c >= '\v' && c <= 'ÿ':
case c >= '\x01' && c <= 'ÿ':
goto yystate27
}
@ -8459,7 +8459,7 @@ yyrule137: // .
l.begin(PHP)
goto yystate0
}
yyrule138: // [\']([^\\\']*([\\].)*)*[\']
yyrule138: // [\']([^\\\']*(\\(.|\n))*)*[\']
{
lval.Token(l.createToken(l.Token()))
return T_CONSTANT_ENCAPSED_STRING

View File

@ -327,7 +327,7 @@ NEW_LINE (\r|\n|\r\n)
<PROPERTY>{VAR_NAME} l.begin(PHP);lval.Token(l.createToken(l.Token())); return T_STRING;
<PROPERTY>. l.ungetChars(1);l.begin(PHP)
<PHP>[\']([^\\\']*([\\].)*)*[\'] lval.Token(l.createToken(l.Token())); return T_CONSTANT_ENCAPSED_STRING;
<PHP>[\']([^\\\']*(\\(.|\n))*)*[\'] lval.Token(l.createToken(l.Token())); return T_CONSTANT_ENCAPSED_STRING;
<PHP>` l.begin(BACKQUOTE); lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0]))
<BACKQUOTE>` l.begin(PHP); lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0]))