Commit 50da04aa authored by Jeffery To's avatar Jeffery To

php.lang: Add support for double quotes around heredoc identifiers

Supported since PHP 5.3.0[1].

[1]: https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
parent 282c20c6
......@@ -160,6 +160,18 @@
</include>
</context>
<context id="here-doc-string-double-quotes" style-ref="here-doc" extend-parent="true">
<start>(&lt;&lt;&lt;)\s?"(\%{identifier})"</start>
<end>^(\%{2@start});?$</end>
<include>
<context sub-pattern="0" where="start" style-ref="here-doc-bound"/>
<context sub-pattern="1" where="end" style-ref="here-doc-bound"/>
<context ref="escape"/>
<context ref="string-var"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="now-doc-string" style-ref="here-doc" extend-parent="true">
<start>(&lt;&lt;&lt;)\s?'(\%{identifier})'</start>
<end>^(\%{2@start});?$</end>
......@@ -335,6 +347,7 @@
<context ref="single-quoted-string"/>
<context ref="backtick-string"/>
<context ref="here-doc-string"/>
<context ref="here-doc-string-double-quotes"/>
<context ref="now-doc-string"/>
<context ref="variable"/>
<context ref="array-operators"/>
......
......@@ -6,3 +6,9 @@ $i數 = 1;
$str <<<extrémité
text
extrémité
echo <<<"END"
a
b
c
END;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment