Merge pull request #60 from imuli/backslash-newline

accept backslash newline in single quotes
This commit is contained in:
Vadym Slizov 2018-07-23 19:18:39 +03:00 committed by GitHub
commit 55a136e9f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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]))