176 lines
5.6 KiB
XML
176 lines
5.6 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<language id="php" _name="PHP" version="2.0" _section="Scripts">
|
|
<metadata>
|
|
<property name="mimetypes">text/x-php;application/x-php;text/x-php-source;application/x-php-source</property>
|
|
<property name="globs">*.php;*.php3;*.php4</property>
|
|
<property name="line-comment-start">#</property>
|
|
</metadata>
|
|
|
|
<styles>
|
|
<style id="comment" _name="Comment" map-to="def:comment"/>
|
|
<style id="data-type" _name="Data Type" map-to="def:data-type"/>
|
|
<style id="string" _name="String" map-to="def:string"/>
|
|
<style id="keyword" _name="Keyword" map-to="def:keyword"/>
|
|
<style id="others" _name="Others"/>
|
|
</styles>
|
|
|
|
<!-- FIXME: keywords before a '(' is hightlined as a function call instead of a keyword -->
|
|
|
|
<definitions>
|
|
<context id="cpp-line-comment" style-ref="comment" end-at-line-end="true">
|
|
<start>//</start>
|
|
<include>
|
|
<context ref="def:escape"/>
|
|
<context ref="def:line-continue"/>
|
|
</include>
|
|
</context>
|
|
<context id="bash-line-comment" style-ref="comment" end-at-line-end="true">
|
|
<start>#</start>
|
|
<include>
|
|
<context ref="def:escape"/>
|
|
<context ref="def:line-continue"/>
|
|
</include>
|
|
</context>
|
|
<context id="c-block-comment" style-ref="comment">
|
|
<start>/\*</start>
|
|
<end>\*/</end>
|
|
<include>
|
|
<context ref="def:escape"/>
|
|
<context ref="def:line-continue"/>
|
|
</include>
|
|
</context>
|
|
<context id="first-open-php-tag" style-ref="others">
|
|
<match><(%|[?](php)?)</match>
|
|
</context>
|
|
<context id="html-block" style-ref="others">
|
|
<start>[%?]></start>
|
|
<end><(%|[?](php)?)</end>
|
|
<include>
|
|
<context ref="def:escape"/>
|
|
<context ref="def:line-continue"/>
|
|
</include>
|
|
</context>
|
|
<context id="double-quoted-string" style-ref="string">
|
|
<start>"</start>
|
|
<end>"</end>
|
|
<include>
|
|
<context ref="def:escape"/>
|
|
<context ref="def:line-continue"/>
|
|
</include>
|
|
</context>
|
|
<context id="single-quoted-string" style-ref="string">
|
|
<start>'</start>
|
|
<end>'</end>
|
|
<include>
|
|
<context ref="def:escape"/>
|
|
<context ref="def:line-continue"/>
|
|
</include>
|
|
</context>
|
|
<context id="backtick-string" style-ref="string">
|
|
<start>`</start>
|
|
<end>`</end>
|
|
<include>
|
|
<context ref="def:escape"/>
|
|
<context ref="def:line-continue"/>
|
|
</include>
|
|
</context>
|
|
<context id="variable" style-ref="data-type">
|
|
<match>[$]+[a-zA-Z_][a-zA-Z0-9_]*</match>
|
|
</context>
|
|
<context id="array-operators" style-ref="data-type">
|
|
<match>(\[|\])</match>
|
|
</context>
|
|
<context id="case-sensitive-keyword" style-ref="keyword">
|
|
<keyword>abstract</keyword>
|
|
<keyword>and</keyword>
|
|
<keyword>as</keyword>
|
|
<keyword>break</keyword>
|
|
<keyword>case</keyword>
|
|
<keyword>catch</keyword>
|
|
<keyword>class</keyword>
|
|
<keyword>const</keyword>
|
|
<keyword>continue</keyword>
|
|
<keyword>default</keyword>
|
|
<keyword>die</keyword>
|
|
<keyword>do</keyword>
|
|
<keyword>echo</keyword>
|
|
<keyword>else</keyword>
|
|
<keyword>elseif</keyword>
|
|
<keyword>endfor</keyword>
|
|
<keyword>endforeach</keyword>
|
|
<keyword>endswitch</keyword>
|
|
<keyword>endwhile</keyword>
|
|
<keyword>extends</keyword>
|
|
<keyword>for</keyword>
|
|
<keyword>global</keyword>
|
|
<keyword>final</keyword>
|
|
<keyword>foreach</keyword>
|
|
<keyword>function</keyword>
|
|
<keyword>if</keyword>
|
|
<keyword>implements</keyword>
|
|
<keyword>import</keyword>
|
|
<keyword>include</keyword>
|
|
<keyword>include_once</keyword>
|
|
<keyword>instanceof</keyword>
|
|
<keyword>interface</keyword>
|
|
<keyword>list</keyword>
|
|
<keyword>namespace</keyword>
|
|
<keyword>new</keyword>
|
|
<keyword>or</keyword>
|
|
<keyword>print</keyword>
|
|
<keyword>private</keyword>
|
|
<keyword>protected</keyword>
|
|
<keyword>public</keyword>
|
|
<keyword>require</keyword>
|
|
<keyword>require_once</keyword>
|
|
<keyword>return</keyword>
|
|
<keyword>static</keyword>
|
|
<keyword>switch</keyword>
|
|
<keyword>throw</keyword>
|
|
<keyword>try</keyword>
|
|
<keyword>var</keyword>
|
|
<keyword>while</keyword>
|
|
<keyword>xor</keyword>
|
|
</context>
|
|
<context id="case-insensitive-keyword" style-ref="keyword">
|
|
<keyword>true</keyword>
|
|
<keyword>false</keyword>
|
|
<keyword>null</keyword>
|
|
</context>
|
|
<context id="operators" style-ref="keyword">
|
|
<match>[-.~^@;:/%|\=\+\*\!\?&<>]</match>
|
|
</context>
|
|
<context id="data-type" style-ref="data-type">
|
|
<keyword>array</keyword>
|
|
<keyword>bool</keyword>
|
|
<keyword>boolean</keyword>
|
|
<keyword>double</keyword>
|
|
<keyword>float</keyword>
|
|
<keyword>int</keyword>
|
|
<keyword>integer</keyword>
|
|
<keyword>object</keyword>
|
|
<keyword>real</keyword>
|
|
<keyword>string</keyword>
|
|
<keyword>unset</keyword>
|
|
</context>
|
|
<context id="php">
|
|
<include>
|
|
<context ref="cpp-line-comment"/>
|
|
<context ref="bash-line-comment"/>
|
|
<context ref="c-block-comment"/>
|
|
<context ref="first-open-php-tag"/>
|
|
<context ref="html-block"/>
|
|
<context ref="double-quoted-string"/>
|
|
<context ref="single-quoted-string"/>
|
|
<context ref="backtick-string"/>
|
|
<context ref="variable"/>
|
|
<context ref="array-operators"/>
|
|
<context ref="case-sensitive-keyword"/>
|
|
<context ref="case-insensitive-keyword"/>
|
|
<context ref="operators"/>
|
|
<context ref="data-type"/>
|
|
</include>
|
|
</context>
|
|
</definitions>
|
|
</language>
|