Warning, /frameworks/syntax-highlighting/data/syntax/varnishcc.xml is written in an unsupported language. File is not indexed.
0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language>
0003 <language name="Varnish module spec file" version="6" kateversion="5.0" section="Sources" extensions="*.vcc" author="Xavier Guerrin (xavier@tuxfamily.org)" license="WTFPL" priority="9">
0004 <highlighting>
0005 <!-- Extracted from the "ctypes" hash in lib/libvmod_std/vmod.py -->
0006 <list name="VCC C Types">
0007 <item>BACKEND</item>
0008 <item>BLOB</item>
0009 <item>BOOL</item>
0010 <item>BYTES</item>
0011 <item>DURATION</item>
0012 <item>HEADER</item>
0013 <item>HTTP</item>
0014 <item>INT</item>
0015 <item>IP</item>
0016 <item>PRIV_CALL</item>
0017 <item>PRIV_VCL</item>
0018 <item>REAL</item>
0019 <item>STRING</item>
0020 <item>STRING_LIST</item>
0021 <item>TIME</item>
0022 <item>VOID</item>
0023 </list>
0024 <contexts>
0025 <!-- Default context: define main keywords. -->
0026 <context name="vccnormal_text" attribute="Normal Text" lineEndContext="#stay">
0027 <IncludeRules context="##reStructuredText" />
0028 <StringDetect firstNonSpace="true" attribute="Keyword" context="module_declaration" String="$Module" endRegion="vcc_block" />
0029 <StringDetect firstNonSpace="true" attribute="Keyword" context="init_declaration" String="$Init" endRegion="vcc_block" />
0030 <StringDetect firstNonSpace="true" attribute="Keyword" context="function_declaration" String="$Function" endRegion="vcc_block" />
0031 <StringDetect firstNonSpace="true" attribute="Keyword" context="object_declaration" String="$Object" endRegion="vcc_block" />
0032 <StringDetect firstNonSpace="true" attribute="Keyword" context="method_declaration" String="$Method" endRegion="vcc_block" />
0033 <IncludeRules context="comments" />
0034 </context>
0035
0036 <!-- Contexts for comments. -->
0037 <context name="comments" attribute="Comment" lineEndContext="#pop">
0038 <DetectChar char="#" context="shell-like-comment" attribute="Comment" />
0039 </context>
0040 <context name="shell-like-comment" attribute="Comment" lineEndContext="#pop">
0041 <DetectSpaces />
0042 <IncludeRules context="##Comments" />
0043 </context>
0044
0045 <!-- Contexts for the "$Module" keyword. -->
0046 <context name="module_declaration" attribute="Normal Text" lineEndContext="#pop">
0047 <RegExpr attribute="VMod Identifier" context="module_section_expected" String="[a-zA-Z][a-zA-Z0-9_]*" />
0048 </context>
0049 <context name="module_section_expected" attribute="Normal Text" lineEndContext="#pop">
0050 <Int attribute="Decimal" context="module_fullname_expected" />
0051 </context>
0052 <context name="module_fullname_expected" attribute="String" lineEndContext="#pop">
0053 </context>
0054
0055 <!-- Contexts for the "$Init" keyword. -->
0056 <context name="init_declaration" attribute="Normal Text" lineEndContext="#pop">
0057 <RegExpr attribute="Function Identifier" context="#stay" String="[a-zA-Z][a-zA-Z0-9_]*$" />
0058 </context>
0059
0060 <!-- Contexts for the "$Function" keyword. -->
0061 <context name="function_declaration" attribute="Normal Text" lineEndContext="#pop">
0062 <keyword attribute="Data Type" String="VCC C Types" context="return_type_declared" />
0063 </context>
0064 <context name="return_type_declared" attribute="Normal Text" lineEndContext="#pop">
0065 <RegExpr attribute="Function Identifier" context="function_name_declared" String="[a-zA-Z][a-zA-Z0-9_]*" />
0066 </context>
0067 <context name="function_name_declared" attribute="Normal Text" lineEndContext="#pop">
0068 <DetectChar char="(" context="function_arg_type_expected" attribute="Normal Text" />
0069 </context>
0070 <context name="function_arg_type_expected" attribute="Normal Text" lineEndContext="#pop">
0071 <keyword attribute="Data Type" String="VCC C Types" context="function_comma_expected" />
0072 <StringDetect String="ENUM" context="enum" attribute="Data Type" />
0073 <DetectChar char=")" context="function_end" attribute="Normal Text" beginRegion="vcc_block" />
0074 </context>
0075 <context name="function_comma_expected" attribute="Normal Text" lineEndContext="#pop">
0076 <DetectChar char="," context="function_arg_type_expected" attribute="Normal Text" />
0077 <DetectChar char=")" context="function_end" attribute="Normal Text" beginRegion="vcc_block" />
0078 </context>
0079 <context name="function_end" attribute="Normal Text" lineEndContext="#pop">
0080 </context>
0081
0082 <!-- Contexts for the "$Object" keyword. -->
0083 <context name="object_declaration" attribute="Normal Text" lineEndContext="#pop">
0084 <!-- Parse $Object as a $Function which does not need to state a return type -->
0085 <IncludeRules context="return_type_declared" />
0086 </context>
0087
0088 <!-- Contexts for the "$Method" keyword. -->
0089 <context name="method_declaration" attribute="Normal Text" lineEndContext="#pop">
0090 <keyword attribute="Data Type" String="VCC C Types" context="method_return_type_declared" />
0091 </context>
0092 <context name="method_return_type_declared" attribute="Normal Text" lineEndContext="#pop">
0093 <RegExpr attribute="Function Identifier" context="function_name_declared" String="\.[a-zA-Z][a-zA-Z0-9_]*" />
0094 </context>
0095
0096 <!-- Contexts for enums. -->
0097 <context name="enum" attribute="Normal Text" lineEndContext="#pop">
0098 <DetectChar char="{" context="enum_c_name_expected" attribute="Normal Text" />
0099 </context>
0100 <context name="enum_c_name_expected" attribute="Normal Text" lineEndContext="#pop">
0101 <RegExpr attribute="Symbol" context="enum_comma_expected" String="[a-z][a-z0-9_]*" />
0102 <DetectChar char="}" context="function_comma_expected" attribute="Normal Text" />
0103 </context>
0104 <context name="enum_comma_expected" attribute="Normal Text" lineEndContext="#pop">
0105 <DetectChar char="," context="enum_c_name_expected" attribute="Normal Text" />
0106 <DetectChar char="}" context="function_comma_expected" attribute="Normal Text" />
0107 </context>
0108 </contexts>
0109 <itemDatas>
0110 <itemData name="Normal Text" defStyleNum="dsNormal" />
0111 <itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
0112 <itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/>
0113 <itemData name="String" defStyleNum="dsString"/>
0114 <itemData name="VMod Identifier" defStyleNum="dsAttribute" /> <!-- #0000FF -->
0115 <itemData name="Function Identifier" defStyleNum="dsFunction" />
0116 <itemData name="Comment" defStyleNum="dsComment" />
0117 <itemData name="Symbol" defStyleNum="dsNormal" spellChecking="false"/>
0118 <itemData name="Keyword" defStyleNum="dsKeyword" />
0119 </itemDatas>
0120 </highlighting>
0121 <general>
0122 <comments>
0123 <comment name="singleLine" start="#" />
0124 </comments>
0125 <keywords casesensitive="1" />
0126 </general>
0127 </language>
0128 <!-- kate: space-indent on; indent-width 2; replace-tabs on; -->