Warning, /frameworks/syntax-highlighting/data/syntax/varnishtest.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language [
0003   <!ENTITY tab "&#9;">
0004 ]>
0005 <language name="Varnish Test Case language" version="14" kateversion="5.79" section="Configuration" extensions="*.vtc" author="Xavier Guerrin (xavier@tuxfamily.org)" license="WTFPL" priority="9">
0006   <highlighting>
0007     <list name="VSLGrouping">
0008       <!-- Extracted from lib/libvarnishapi/vsl_arg.c -->
0009       <item>raw</item>
0010       <item>vxid</item>
0011       <item>request</item>
0012       <item>session</item>
0013     </list>
0014     <list name="VSLTags">
0015       <!--
0016         Extracted using:
0017           perl -nlE 'push(@tags, $1) if m#^([^ ]+) - #; END { map { printf("      <item>%s</item>\n", $_); } @tags; }' lib/libvarnishapi/vsl-tags.rst
0018       -->
0019       <item>Backend</item>
0020       <item>BackendClose</item>
0021       <item>BackendOpen</item>
0022       <item>BackendReuse</item>
0023       <item>Backend_health</item>
0024       <item>Begin</item>
0025       <item>BereqAcct</item>
0026       <item>BereqHeader</item>
0027       <item>BereqMethod</item>
0028       <item>BereqProtocol</item>
0029       <item>BereqURL</item>
0030       <item>BerespHeader</item>
0031       <item>BerespProtocol</item>
0032       <item>BerespReason</item>
0033       <item>BerespStatus</item>
0034       <item>BogoHeader</item>
0035       <item>CLI</item>
0036       <item>Debug</item>
0037       <item>ESI_BodyBytes</item>
0038       <item>ESI_xmlerror</item>
0039       <item>End</item>
0040       <item>Error</item>
0041       <item>ExpBan</item>
0042       <item>ExpKill</item>
0043       <item>FetchError</item>
0044       <item>Fetch_Body</item>
0045       <item>Gzip</item>
0046       <item>Hash</item>
0047       <item>Hit</item>
0048       <item>HitPass</item>
0049       <item>HttpGarbage</item>
0050       <item>Length</item>
0051       <item>Link</item>
0052       <item>LostHeader</item>
0053       <item>ObjHeader</item>
0054       <item>ObjProtocol</item>
0055       <item>ObjReason</item>
0056       <item>ObjStatus</item>
0057       <item>PipeAcct</item>
0058       <item>ReqAcct</item>
0059       <item>ReqHeader</item>
0060       <item>ReqMethod</item>
0061       <item>ReqProtocol</item>
0062       <item>ReqStart</item>
0063       <item>ReqURL</item>
0064       <item>RespHeader</item>
0065       <item>RespProtocol</item>
0066       <item>RespReason</item>
0067       <item>RespStatus</item>
0068       <item>SessClose</item>
0069       <item>SessOpen</item>
0070       <item>Storage</item>
0071       <item>TTL</item>
0072       <item>Timestamp</item>
0073       <item>VCL_Error</item>
0074       <item>VCL_Log</item>
0075       <item>VCL_acl</item>
0076       <item>VCL_call</item>
0077       <item>VCL_return</item>
0078       <item>VCL_trace</item>
0079       <item>VSL</item>
0080       <item>WorkThread</item>
0081     </list>
0082     <contexts>
0083       <!-- default context: define main keywords -->
0084       <context name="vtcnormal_text" attribute="Normal Text" lineEndContext="#stay">
0085         <IncludeRules context="global_directives_restricted" />
0086         <IncludeRules context="global_directives" />
0087       </context>
0088 
0089       <!-- directives that can be encountered at global scope but not within a loop -->
0090       <context name="global_directives_restricted" attribute="Normal Text" lineEndContext="#stay">
0091         <StringDetect firstNonSpace="true" attribute="Keyword" context="varnishtest_declaration" String="varnishtest" />
0092         <StringDetect firstNonSpace="true" attribute="Keyword" context="feature_instruction"     String="feature" />
0093         <RegExpr attribute="Keyword" context="#stay"     String="^\s*random\s*$" column="0" />
0094       </context>
0095 
0096       <!-- directives that can be encountered at global scope, either directly or within a loop  -->
0097       <context name="global_directives" attribute="Normal Text" lineEndContext="#stay">
0098         <IncludeRules context="comments" />
0099         <StringDetect firstNonSpace="true" attribute="Keyword" context="client_declaration"      String="client" />
0100         <StringDetect firstNonSpace="true" attribute="Keyword" context="server_declaration"      String="server" />
0101         <StringDetect firstNonSpace="true" attribute="Keyword" context="varnish_declaration"     String="varnish" />
0102         <StringDetect firstNonSpace="true" attribute="Keyword" context="logexpect_declaration"   String="logexpect" />
0103         <StringDetect firstNonSpace="true" attribute="Keyword" context="sema_instruction"        String="sema" />
0104         <StringDetect firstNonSpace="true" attribute="Keyword" context="shell_instruction"       String="shell" />
0105         <StringDetect firstNonSpace="true" attribute="Keyword" context="delay_instruction"       String="delay" />
0106         <StringDetect firstNonSpace="true" attribute="Keyword" context="global_loop_instruction" String="loop" />
0107       </context>
0108 
0109       <!-- Strings delimited with double quotes -->
0110       <context name="strings" attribute="Normal Text" lineEndContext="#stay">
0111         <DetectChar char="&quot;" context="string" attribute="String" />
0112       </context>
0113       <context name="string" attribute="String" lineEndContext="#pop">
0114         <Detect2Chars attribute="String" context="#stay" char="\" char1="&quot;" />
0115         <DetectChar attribute="String" context="#pop" char="&quot;" />
0116       </context>
0117 
0118       <!-- The following contexts (quoted-, brace- and unquoted- strings) make their parent pop as soon as they parsed a string. -->
0119       <context name="quoted-strings" attribute="Normal Text" lineEndContext="#stay">
0120         <DetectChar char="&quot;" context="quoted-string" attribute="String" />
0121       </context>
0122       <context name="quoted-string" attribute="String" lineEndContext="#pop#pop">
0123         <Detect2Chars attribute="String" context="#stay" char="\" char1="&quot;" />
0124         <DetectChar attribute="String" context="#pop#pop" char="&quot;" />
0125       </context>
0126 
0127       <context name="brace-strings" attribute="Normal Text" lineEndContext="#pop">
0128         <DetectChar attribute="String" context="brace-string" char="{" beginRegion="string_block" />
0129       </context>
0130       <context name="brace-string" attribute="String" lineEndContext="#stay">
0131         <!--
0132           strings delimited with braces do not require to escape closing braces;
0133           therefore, we have to use an extra context to keep track of opening and closing braces
0134         -->
0135         <DetectChar attribute="String" context="brace-string-internal" char="{" />
0136         <DetectChar attribute="String" context="#pop#pop" char="}" endRegion="string_block" />
0137       </context>
0138       <context name="brace-string-internal" attribute="String" lineEndContext="#stay">
0139         <DetectChar attribute="String" context="#pop" char="}" />
0140       </context>
0141 
0142       <context name="unquoted-strings" attribute="String" lineEndContext="#pop">
0143         <RegExpr attribute="String" context="unquoted-string" String="[^ ]" />
0144       </context>
0145       <context name="unquoted-string" attribute="String" lineEndContext="#pop#pop">
0146         <AnyChar attribute="Normal Text" context="#pop#pop" String="&tab; " />
0147       </context>
0148 
0149       <!-- This context exits as soon as it parsed a string, be it defined between braces, quotes or spaces -->
0150       <context name="string-arg" attribute="Normal Text" lineEndContext="#stay">
0151         <RegExpr attribute="HTTP announce"        context="#pop" String="HTTP/[0-9.]+" />
0152         <RegExpr attribute="HTTP method"          context="#pop" String="\s+(GET|HEAD|POST|PUT|DELETE|TRACE|OPTIONS|CONNECT|PATCH)" />
0153         <RegExpr attribute="HTTP WebDAV method"   context="#pop" String="\s+(PROPFIND|PROPPATCH|MKCOL|COPY|MOVE|LOCK|UNLOCK|CONNECT|PATCH)" />
0154         <RegExpr attribute="HTTP custom method"   context="#pop" String="\s+(PURGE|PURGESTR)" />
0155         <IncludeRules context="brace-strings" />
0156         <IncludeRules context="quoted-strings" />
0157         <IncludeRules context="unquoted-strings" />
0158       </context>
0159 
0160       <!-- This context exits as soon as it parsed an integer. -->
0161       <context name="int-arg" attribute="Normal Text" lineEndContext="#pop">
0162         <Int attribute="Decimal" context="#pop" />
0163       </context>
0164 
0165       <!-- This context exits as soon as it parsed a status integer. -->
0166       <context name="status-arg" attribute="String" lineEndContext="#pop">
0167         <!-- HTTP status can be provided within quotes too. -->
0168         <RegExpr attribute="Decimal" context="#pop" String="(&quot;[12345][0-9]{2}&quot;|[12345][0-9]{2})(?![0-9])" />
0169       </context>
0170 
0171       <!-- Comments -->
0172       <context name="shell-like-comment" attribute="Comment" lineEndContext="#pop">
0173         <DetectSpaces />
0174         <IncludeRules context="##Comments" />
0175         <DetectIdentifier />
0176       </context>
0177       <context name="comments" attribute="Comment" lineEndContext="#pop">
0178         <DetectChar   char="#" context="shell-like-comment" attribute="Comment" />
0179       </context>
0180 
0181       <!-- Define base elements that used within various contexts -->
0182       <context name="base_elements" attribute="Normal Text" lineEndContext="#stay">
0183         <RegExpr attribute="HTTP announce"        context="#stay" String="HTTP/[0-9.]+" />
0184         <RegExpr attribute="HTTP method"          context="#stay" String="\s+(GET|HEAD|POST|PUT|DELETE|TRACE|OPTIONS|CONNECT|PATCH)" />
0185         <RegExpr attribute="HTTP WebDAV method"   context="#stay" String="\s+(PROPFIND|PROPPATCH|MKCOL|COPY|MOVE|LOCK|UNLOCK|CONNECT|PATCH)" />
0186         <RegExpr attribute="HTTP custom method"   context="#stay" String="\s+(PURGE|PURGESTR)" />
0187         <Float attribute="Float" context="#stay" />
0188         <Int attribute="Decimal" context="#stay" />
0189         <IncludeRules context="strings" />
0190         <IncludeRules context="comments" />
0191       </context>
0192 
0193       <!--
0194         Define syntax of the -expect command for server and client objects.
0195         Written from cmd_http_expect() in bin/varnishtest/vtc_http.c.
0196       -->
0197       <context name="http_expectation" attribute="Normal Text" lineEndContext="#pop">
0198         <IncludeRules context="comments" />
0199         <RegExpr    attribute="Float"                context="http_expectation_operator" String="[0-9\.]+(\s+|$)" />
0200         <RegExpr    attribute="Decimal"              context="http_expectation_operator" String="[0-9]+(\s+|$)" />
0201         <StringDetect attribute="Keyword"            context="http_expectation_operator" String="&lt;undef&gt;" />
0202         <!-- Written from cmd_var_resolve() in bin/varnishtest/vtc_http.c. -->
0203         <RegExpr    attribute="HTTP Property"        context="http_expectation_operator" String="req\.(method|url|proto|bodylen)|resp\.(proto|status|msg|chunklen|bodylen|body)" />
0204         <RegExpr    attribute="HTTP X- Header"       context="http_expectation_operator" String="(req|resp)\.http\.X\-[\-_A-Za-z0-9]*" />
0205         <RegExpr    attribute="HTTP Header"          context="http_expectation_operator" String="(req|resp)\.http\.[A-Za-z][\-_A-Za-z0-9]*" />
0206         <RegExpr    attribute="HTTP announce"        context="http_expectation_operator" String="HTTP/[0-9\.]+" />
0207         <RegExpr    attribute="HTTP method"          context="http_expectation_operator" String="\s+(GET|HEAD|POST|PUT|DELETE|TRACE|OPTIONS|CONNECT|PATCH)" />
0208         <RegExpr    attribute="HTTP WebDAV method"   context="http_expectation_operator" String="\s+(PROPFIND|PROPPATCH|MKCOL|COPY|MOVE|LOCK|UNLOCK|CONNECT|PATCH)" />
0209         <RegExpr    attribute="HTTP custom method"   context="http_expectation_operator" String="\s+(PURGE|PURGESTR)" />
0210         <DetectChar attribute="String"               context="http_expectation_arg1_brace-string" char="{" beginRegion="string_block" />
0211         <DetectChar attribute="String"               context="http_expectation_arg1_quoted-string" char="&quot;" />
0212         <RegExpr    attribute="Normal Text"          context="http_expectation_arg1_unquoted-string" String="[^ ]" lookAhead="true" />
0213       </context>
0214       <context name="http_expectation_operator" attribute="Normal Text" lineEndContext="#pop#pop">
0215         <IncludeRules context="comments" />
0216         <Detect2Chars attribute="Comparison Operator" context="common_expectation_second_arg" char="=" char1="=" />
0217         <Detect2Chars attribute="Comparison Operator" context="common_expectation_second_arg" char="!" char1="=" />
0218         <Detect2Chars attribute="Comparison Operator" context="common_expectation_second_arg" char="&gt;" char1="=" />
0219         <Detect2Chars attribute="Comparison Operator" context="common_expectation_second_arg" char="&lt;" char1="=" />
0220         <AnyChar attribute="Comparison Operator" context="common_expectation_second_arg" String="&gt;&lt;~" />
0221         <Detect2Chars attribute="Comparison Operator" context="common_expectation_second_arg" char="!" char1="~" />
0222       </context>
0223       <context name="common_expectation_second_arg" attribute="Normal Text" lineEndContext="#pop#pop#pop">
0224         <IncludeRules context="comments" />
0225         <RegExpr    attribute="Float"                context="common_expectation_end" String="[0-9\.]+(\s+|$)" />
0226         <RegExpr    attribute="Decimal"              context="common_expectation_end" String="[0-9]+(\s+|$)" />
0227         <StringDetect attribute="Keyword"            context="common_expectation_end" String="&lt;undef&gt;" />
0228         <!-- Written from cmd_var_resolve() in bin/varnishtest/vtc_http.c. -->
0229         <RegExpr    attribute="HTTP Property"        context="common_expectation_end" String="req\.(method|url|proto|bodylen)|resp\.(proto|status|msg|chunklen|bodylen|body)" />
0230         <RegExpr    attribute="HTTP X- Header"       context="common_expectation_end" String="(req|resp)\.http\.X\-[\-_A-Za-z0-9]*" />
0231         <RegExpr    attribute="HTTP Header"          context="common_expectation_end" String="(req|resp)\.http\.[A-Za-z][\-_A-Za-z0-9]*" />
0232         <RegExpr    attribute="HTTP announce"        context="common_expectation_end" String="HTTP/[0-9\.]+" />
0233         <RegExpr    attribute="HTTP method"          context="common_expectation_end" String="\s+(GET|HEAD|POST|PUT|DELETE|TRACE|OPTIONS|CONNECT|PATCH)" />
0234         <RegExpr    attribute="HTTP WebDAV method"   context="common_expectation_end" String="\s+(PROPFIND|PROPPATCH|MKCOL|COPY|MOVE|LOCK|UNLOCK|CONNECT|PATCH)" />
0235         <RegExpr    attribute="HTTP custom method"   context="common_expectation_end" String="\s+(PURGE|PURGESTR)" />
0236         <DetectChar attribute="String"               context="common_expectation_arg2_brace-string" char="{" beginRegion="string_block" />
0237         <DetectChar attribute="String"               context="common_expectation_arg2_quoted-string" char="&quot;" />
0238         <RegExpr    attribute="Normal Text"          context="common_expectation_arg2_unquoted-string" String="[^ ]" lookAhead="true" />
0239       </context>
0240       <context name="common_expectation_end" attribute="Normal Text" lineEndContext="#pop#pop#pop#pop">
0241         <IncludeRules context="comments" />
0242       </context>
0243 
0244       <!-- Contexts to parse first argument of server/client expectations as a string -->
0245       <context name="http_expectation_arg1_brace-string" attribute="String" lineEndContext="#stay">
0246         <DetectChar attribute="String" context="brace-string-internal" char="{" />
0247         <DetectChar attribute="String" context="http_expectation_operator" char="}" endRegion="string_block" />
0248       </context>
0249       <context name="http_expectation_arg1_quoted-string" attribute="String" lineEndContext="#pop#pop">
0250         <Detect2Chars attribute="String" context="#stay" char="\" char1="&quot;" />
0251         <DetectChar   attribute="String" context="http_expectation_operator" char="&quot;" />
0252       </context>
0253       <context name="http_expectation_arg1_unquoted-string" attribute="String" lineEndContext="#pop#pop">
0254         <AnyChar attribute="Normal Text" context="http_expectation_operator" String="&tab; " />
0255       </context>
0256 
0257       <!-- Contexts to parse second argument of all expectations as a string -->
0258       <context name="common_expectation_arg2_brace-string" attribute="String" lineEndContext="#stay">
0259         <DetectChar attribute="String" context="brace-string-internal" char="{" />
0260         <DetectChar attribute="String" context="common_expectation_end" char="}" endRegion="string_block" />
0261       </context>
0262       <context name="common_expectation_arg2_quoted-string" attribute="String" lineEndContext="#pop#pop">
0263         <Detect2Chars attribute="String" context="#stay" char="\" char1="&quot;" />
0264         <DetectChar   attribute="String" context="common_expectation_end" char="&quot;" />
0265       </context>
0266       <context name="common_expectation_arg2_unquoted-string" attribute="String" lineEndContext="#pop#pop">
0267         <AnyChar attribute="Normal Text" context="common_expectation_end" String="&tab; " />
0268       </context>
0269 
0270       <!--
0271         Define syntax of the -expect command for varnish objects.
0272         Written from varnish_expect() in bin/varnishtest/vtc_varnish.c
0273       -->
0274       <context name="varnish_expectation" attribute="Normal Text" lineEndContext="#pop">
0275         <!-- Varnish's expect takes a Varnish counter as first argument. -->
0276         <IncludeRules context="comments" />
0277         <!-- Mostly extracted using man 7 varnish-counters | grep - - - | grep _ | sort -->
0278         <!-- MEMPOOL.* found out in c00050.vtc -->
0279         <RegExpr attribute="VarnishStat metric"    context="varnish_expectation_operator" String="backend_(?:busy|conn|fail|recycle|req|retry|reuse|toolate|unhealthy)|bans_(?:added|completed|deleted|dups|lurker_(?:contention|obj_killed|tested|tests_tested)|obj|obj_killed|persisted_(bytes|fragmentation)|req|tested|tests_tested)|busy_(?:sleep|wakeup)|cache_(?:hit(pass)?|miss)|client_(?:req|req_4(?:00|11|13|17))|esi_(?:errors|warnings)|exp_(?:mailed|received)|fetch_(?:1xx|204|304|bad|chunked|close|eof|failed|head|length|oldhttp|zero)|hcb_(?:insert|lock|nolock)|n_(?:backend|expired|gunzip|gzip|lru_moved|lru_nuked|obj_purged|object|objectcore|objecthead|purges|vampireobject|vcl|vcl_avail|vcl_discard|waitinglist)|s_(?:fetch|pass|pipe|pipe_(?:hdrbytes|in|out)|req|(req|resp)_(?:body|hdr)bytes|sess|synth)|sess_(?:closed|conn|drop|dropped|fail|herd|pipe_overflow|pipeline|queued|readahead)|shm_(?:cont|cycles|flushes|records|writes)|sms_(?:balloc|bfree|nbytes|nobj|nreq)|thread_(?:queue_len|created|destroyed|failed|limited)|vsm_(?:cooling|free|overflow(ed)?|user)|(?:bans|losthdr|pools|threads|uptime|vmods)|LCK\.(?:sm[spaf]|hsl|hcb|hcl|vcl|stat|sessmem|wstat|herder|wq|objhdr|exp|lru|cli|ban|vbp|vbe|backend)\.(?:creat|destroy|locks)|SMA\.[a-zA-Z0-9_\-]+\.(?:c_(?:req|fail|bytes|freed)|g_(?:alloc|bytes|space))|SMF\.[a-zA-Z0-9_\-]+\.(?:c_(?:req|fail|bytes|freed)|g_(?:alloc|bytes|space|smf|smf_frag|smf_large))|VBE\..+\.(?:happy|vcls|be(?:req|resp)_(?:body|hdr)bytes|pipe_(?:in|hdrbytes|out))|MEMPOOL\.vbc\.(?:pool|surplus|timeout)" />
0280       </context>
0281       <context name="varnish_expectation_operator" attribute="Normal Text" lineEndContext="#pop#pop">
0282         <IncludeRules context="comments" />
0283         <Detect2Chars attribute="Comparison Operator" context="varnish_expectation_second_arg" char="=" char1="=" />
0284         <Detect2Chars attribute="Comparison Operator" context="varnish_expectation_second_arg" char="!" char1="=" />
0285         <Detect2Chars attribute="Comparison Operator" context="varnish_expectation_second_arg" char="&gt;" char1="=" />
0286         <Detect2Chars attribute="Comparison Operator" context="varnish_expectation_second_arg" char="&lt;" char1="=" />
0287         <AnyChar attribute="Comparison Operator" context="varnish_expectation_second_arg" String="&gt;&lt;" />
0288         <!-- Varnish's expect does not handle the ~ and !~ operators -->
0289       </context>
0290       <context name="varnish_expectation_second_arg" attribute="Normal Text" lineEndContext="#pop">
0291         <!-- Varnish's expect takes an unsigned integer as second argument. -->
0292         <Int attribute="Decimal" context="common_expectation_end" />
0293       </context>
0294 
0295       <!-- Define macros -->
0296       <context name="macro_accepted" attribute="String" lineEndContext="#pop">
0297         <Detect2Chars char="$" char1="{" attribute="String" context="macro_identifier" />
0298       </context>
0299       <context name="macro_identifier" attribute="String" lineEndContext="#pop#pop">
0300         <DetectChar char="}" attribute="String" context="#pop" />
0301       </context>
0302 
0303       <!-- Define syntax for main keywords' options -->
0304       <context name="common_options" attribute="Normal Text" lineEndContext="#stay">
0305         <IncludeRules context="macro_accepted" />
0306         <IncludeRules context="base_elements" />
0307       </context>
0308 
0309       <context name="client_options" attribute="Normal Text" lineEndContext="#stay">
0310         <!-- Extracted from bin/varnishtest/vtc_client.c  -->
0311         <RegExpr attribute="Keyword" context="#stay" String="\-(?:run|start|wait)" />
0312         <StringDetect attribute="Keyword" context="int-arg" String="-repeat" />
0313         <StringDetect attribute="Keyword" context="string-arg" String="-connect" />
0314         <StringDetect attribute="Keyword" context="http_expectation" String="-expect" />
0315         <IncludeRules context="common_options" />
0316       </context>
0317 
0318       <context name="server_options" attribute="Normal Text" lineEndContext="#stay" >
0319         <!-- Extracted from bin/varnishtest/vtc_server.c  -->
0320         <RegExpr attribute="Keyword" context="#stay" String="\-(?:break|start|wait)" />
0321         <StringDetect attribute="Keyword" context="int-arg" String="-repeat" />
0322         <StringDetect attribute="Keyword" context="string-arg" String="-listen " />
0323         <StringDetect attribute="Keyword" context="http_expectation" String="-expect" />
0324         <IncludeRules context="common_options" />
0325       </context>
0326 
0327       <context name="varnish_options" attribute="Normal Text" lineEndContext="#stay" >
0328         <!-- Extracted from bin/varnishtest/vtc_varnish.c  -->
0329         <RegExpr attribute="Keyword" context="#stay" String="\-(?:start|stop|wait|wait-running|wait-stopped)" />
0330         <RegExpr attribute="Keyword" context="string-arg" String="\-(?:arg|cli|cliok|storage) " />
0331         <StringDetect attribute="Keyword" context="clierr_options" String="-clierr " />
0332         <StringDetect attribute="Keyword" context="varnish_expectation" String="-expect" />
0333         <IncludeRules context="common_options" />
0334       </context>
0335 
0336       <context name="logexpect_options" attribute="Normal Text" lineEndContext="#stay" >
0337         <!-- Extracted from bin/varnishtest/vtc_logexp.c -->
0338         <RegExpr attribute="Keyword" context="#stay" String="\-(?:start|run|wait)" />
0339       </context>
0340 
0341       <context name="clierr_options" attribute="Normal Text" lineEndContext="#pop">
0342         <!-- unlike clikok, clierr requires an integer argument first -->
0343         <Int attribute="Decimal" context="clierr_command" />
0344         <!-- It seems that integer can be provided within quotes though. -->
0345         <RegExpr attribute="Decimal" context="clierr_command" String="&quot;[0-9]+&quot; " />
0346         <IncludeRules context="comments" />
0347       </context>
0348       <context name="clierr_command" attribute="String" lineEndContext="#pop">
0349         <IncludeRules context="comments" />
0350       </context>
0351 
0352       <context name="tx_options" attribute="Normal Text" lineEndContext="#pop">
0353         <IncludeRules context="comments" />
0354         <StringDetect attribute="Tx Keyword" String="-nolen" />
0355         <RegExpr attribute="Tx Keyword" context="string-arg" String="\-(?:body|gzipbody|hdr|proto) " />
0356         <RegExpr attribute="Tx Keyword" context="int-arg" String="\-(?:bodylen|gzip(?:len|residual|level))" />
0357         <LineContinue attribute="Normal Text" context="#stay" />
0358       </context>
0359 
0360       <!-- Define syntax for the client-specific txreq keyword -->
0361       <context name="txreq_options" attribute="String" lineEndContext="#pop">
0362         <IncludeRules context="tx_options" />
0363         <RegExpr attribute="TxReq Keyword" context="string-arg" String="\-(?:req|url)" />
0364       </context>
0365 
0366       <!-- Define syntax for the server-specific txresp keyword -->
0367       <context name="txresp_options" attribute="Normal Text" lineEndContext="#pop">
0368         <IncludeRules context="tx_options" />
0369         <StringDetect attribute="TxResp Keyword" context="string-arg" String="-msg" />
0370         <StringDetect attribute="TxResp Keyword" context="status-arg" String="-status" />
0371       </context>
0372 
0373       <!-- Define syntax for the client-specific rxresp keyword -->
0374       <context name="rxresp_options" attribute="Normal Text" lineEndContext="#pop">
0375         <IncludeRules context="comments" />
0376         <StringDetect attribute="RxResp Keyword" String="-no_obj" />
0377         <LineContinue attribute="Normal Text" context="#stay" />
0378       </context>
0379 
0380       <!-- varnishtest keyword -->
0381       <context name="varnishtest_declaration" attribute="Normal Text" lineEndContext="#pop">
0382         <IncludeRules context="strings" />
0383         <IncludeRules context="comments" />
0384       </context>
0385 
0386       <!-- client/server HTTP commands -->
0387       <context name="clientserver_common_definition" attribute="Normal Text" lineEndContext="#stay">
0388         <IncludeRules context="comments" />
0389         <!-- Extracted using:
0390             perl -nlE '$p = 1 if m#http_cmds\[\]#; say if ($p); exit if ($p && m#^\}#);' vtc_http.c
0391             egrep '(^cmd_http_|^\s*ONLY_(CLIENT|SERVER))' bin/varnishtest/vtc_http.c
0392         -->
0393         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="timeout_instruction"     String="timeout" />
0394         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="gunzip" />
0395         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="expect_close" />
0396         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="http_expectation"        String="expect" />
0397         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="send_instruction"        String="sendhex" />
0398         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="send_instruction"        String="send" />
0399         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="chunkedlen_instruction"  String="chunkedlen" />
0400         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="send_instruction"        String="chunked" />
0401         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="delay_instruction"       String="delay" />
0402         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="sema_instruction"        String="sema" />
0403         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="close" />
0404         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="accept" />
0405         <!-- loop is not there as its parsing changes depending on server or client. -->
0406         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="fatal" />
0407         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="non-fatal" />
0408       </context>
0409 
0410       <!-- client keyword -->
0411       <context name="client_declaration" attribute="Normal Text" lineEndContext="#pop">
0412         <DetectIdentifier attribute="Client Identifier" context="client_identified" />
0413       </context>
0414       <context name="client_identified" attribute="String" lineEndContext="#pop">
0415         <IncludeRules context="client_options" />
0416         <DetectChar attribute="Region Marker" context="client_definition" char="{" beginRegion="client_block" />
0417         <LineContinue attribute="Normal Text" context="#stay" />
0418       </context>
0419       <context name="client_definition" attribute="Normal Text" lineEndContext="#stay">
0420         <IncludeRules context="clientserver_common_definition" />
0421         <!-- client-specific HTTP commands -->
0422         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="txreq_options"           String="txreq" />
0423         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="rxresphdrs" />
0424         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="rxresp_options"          String="rxresp" />
0425         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="rxchunk" />
0426         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="client_loop_instruction" String="loop" />
0427         <DetectChar attribute="Region Marker" context="client_postdefinition" char="}" endRegion="client_block" />
0428       </context>
0429       <context name="client_postdefinition" attribute="Normal Text" lineEndContext="#pop#pop#pop#pop">
0430         <IncludeRules context="client_options" />
0431         <LineContinue attribute="Normal Text" context="#stay" />
0432       </context>
0433 
0434       <!-- server keyword -->
0435       <context name="server_declaration" attribute="Normal Text" lineEndContext="#pop">
0436         <DetectIdentifier attribute="Server Identifier" context="server_identified" />
0437       </context>
0438       <context name="server_identified" attribute="String" lineEndContext="#pop">
0439         <IncludeRules context="server_options" />
0440         <DetectChar attribute="Region Marker" context="server_definition" char="{" beginRegion="server_block" />
0441         <LineContinue attribute="Normal Text" context="#stay" />
0442       </context>
0443       <context name="server_definition" attribute="Normal Text" lineEndContext="#stay">
0444         <IncludeRules context="clientserver_common_definition" />
0445         <!-- server-specific HTTP commands -->
0446         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="rxreqhdrs" />
0447         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="rxreq" />
0448         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="#stay"                   String="rxbody" />
0449         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="txresp_options"          String="txresp" />
0450         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="server_loop_instruction" String="loop" />
0451         <DetectChar attribute="Region Marker" context="server_postdefinition" char="}" endRegion="server_block" />
0452       </context>
0453       <context name="server_postdefinition" attribute="Normal Text" lineEndContext="#pop#pop#pop#pop">
0454         <IncludeRules context="server_options" />
0455         <LineContinue attribute="Normal Text" context="#stay" />
0456       </context>
0457 
0458       <!-- varnish keyword -->
0459       <context name="varnish_declaration" attribute="Normal Text" lineEndContext="#pop">
0460         <DetectIdentifier attribute="Varnish Identifier" context="varnish_identified" />
0461       </context>
0462       <context name="varnish_identified" attribute="Normal Text" lineEndContext="#pop">
0463         <IncludeRules context="varnish_options" />
0464         <RegExpr attribute="Keyword" context="varnish_vclannounced" String="\s*\-vcl(?:\+backend)?" />
0465         <RegExpr attribute="Keyword" context="varnish_errvclannounced" String="\s*\-errvcl" />
0466         <LineContinue attribute="Normal Text" context="#stay" />
0467       </context>
0468       <context name="varnish_vclannounced" attribute="Normal Text" lineEndContext="#stay">
0469         <DetectChar attribute="Region Marker" context="varnish_vcldefinition" char="{" beginRegion="varnish_block" />
0470       </context>
0471       <context name="varnish_vcldefinition" attribute="Normal Text" lineEndContext="#stay">
0472         <IncludeRules context="##Varnish Configuration Language" />
0473         <DetectChar attribute="Region Marker" context="varnish_postvcldefinition" char="}" endRegion="varnish_block" />
0474       </context>
0475       <context name="varnish_postvcldefinition" attribute="Normal Text" lineEndContext="#pop#pop#pop#pop#pop">
0476         <IncludeRules context="varnish_options" />
0477         <LineContinue attribute="Normal Text" context="#stay" />
0478       </context>
0479       <context name="varnish_errvclannounced" attribute="Normal Text" lineEndContext="#stay">
0480         <DetectChar char="&quot;" context="errvcl_expected_error_quoted" attribute="String" />
0481         <DetectChar char="{" context="errvcl_expected_error_brace" attribute="String" beginRegion="string_block" />
0482       </context>
0483       <context name="errvcl_expected_error_quoted" attribute="String" lineEndContext="#pop">
0484         <Detect2Chars attribute="String" context="#stay" char="\" char1="&quot;" />
0485         <DetectChar attribute="String" context="varnish_errvcldefined" char="&quot;" />
0486       </context>
0487       <context name="errvcl_expected_error_brace" attribute="String" lineEndContext="#pop">
0488         <DetectChar attribute="String" context="brace-string-internal" char="{" />
0489         <DetectChar attribute="String" context="varnish_errvcldefined" char="}" endRegion="string_block" />
0490       </context>
0491       <context name="varnish_errvcldefined" attribute="Normal Text" lineEndContext="#pop">
0492         <DetectChar attribute="Region Marker" context="varnish_errvclcode" char="{" beginRegion="errvclcode_block" />
0493       </context>
0494       <context name="varnish_errvclcode" attribute="Normal Text" lineEndContext="#stay">
0495         <DetectChar attribute="Normal Text" context="varnish_errvclcode-internal" char="{" />
0496         <DetectChar attribute="Region Marker" context="varnish_postvcldefinition" char="}" endRegion="errvclcode_block" />
0497       </context>
0498       <context name="varnish_errvclcode-internal" attribute="Normal Text" lineEndContext="#stay">
0499         <DetectChar attribute="Normal Text" context="varnish_errvclcode-internal" char="{" />
0500         <DetectChar attribute="Normal Text" context="#pop" char="}" />
0501       </context>
0502 
0503       <context name="logexpect_declaration" attribute="Normal Text" lineEndContext="#pop">
0504         <DetectIdentifier attribute="LogExpect Identifier" context="logexpect_identified" />
0505       </context>
0506       <context name="logexpect_identified" attribute="Normal Text" lineEndContext="#pop">
0507         <LineContinue attribute="Normal Text" context="#stay" />
0508         <IncludeRules context="logexpect_options" />
0509         <!-- Extracted from bin/varnishtest/vtc_logexp.c -->
0510         <Detect2Chars attribute="Keyword" char="-" char1="v" context="logexpect_varnishinstance_arg" />
0511         <Detect2Chars attribute="Keyword" char="-" char1="g" context="logexpect_grouping_arg" />
0512         <Detect2Chars attribute="Keyword" char="-" char1="d" context="logexpect_headtailmode_arg" />
0513         <Detect2Chars attribute="Keyword" char="-" char1="q" context="logexpect_query_arg" />
0514         <DetectChar attribute="Region Marker" context="logexpect_definition" char="{" beginRegion="logexpect_block" />
0515       </context>
0516       <context name="logexpect_varnishinstance_arg" attribute="Normal Text" lineEndContext="#pop">
0517         <DetectIdentifier attribute="Varnish Identifier" context="#pop" />
0518       </context>
0519       <context name="logexpect_grouping_arg" attribute="Normal Text" lineEndContext="#pop">
0520         <keyword attribute="VSL Grouping" context="#pop" String="VSLGrouping" />
0521       </context>
0522       <context name="logexpect_headtailmode_arg" attribute="Normal Text" lineEndContext="#pop">
0523         <AnyChar attribute="Decimal" context="#pop" String="01" />
0524       </context>
0525       <context name="logexpect_query_arg" attribute="Normal Text" lineEndContext="#pop">
0526         <IncludeRules context="string-arg" />
0527       </context>
0528       <context name="logexpect_definition" attribute="Normal Text" lineEndContext="#stay">
0529         <DetectChar attribute="Region Marker" context="logexpect_postdefinition" char="}" endRegion="logexpect_block" />
0530         <StringDetect firstNonSpace="true" attribute="Action Keyword" context="logexpect_skip" String="expect" />
0531       </context>
0532       <context name="logexpect_postdefinition" attribute="Normal Text" lineEndContext="#pop#pop#pop#pop">
0533         <IncludeRules context="logexpect_options" />
0534       </context>
0535       <context name="logexpect_skip" attribute="Normal Text" lineEndContext="#pop">
0536         <Int attribute="Decimal" context="logexpect_vxid" />
0537         <DetectChar attribute="Logical Operator" context="logexpect_vxid" char="*" />
0538       </context>
0539       <context name="logexpect_vxid" attribute="Normal Text" lineEndContext="#pop">
0540         <Int attribute="Decimal" context="logexpect_tag" />
0541         <AnyChar attribute="Logical Operator" context="logexpect_tag" String="*=" />
0542       </context>
0543       <context name="logexpect_tag" attribute="Normal Text" lineEndContext="#pop">
0544         <keyword attribute="VSL Tag" context="logexpect_regex" String="VSLTags" />
0545         <AnyChar attribute="Logical Operator" context="logexpect_regex" String="*=" />
0546       </context>
0547       <context name="logexpect_regex" attribute="String" lineEndContext="#pop">
0548         <IncludeRules context="brace-strings" />
0549         <IncludeRules context="quoted-strings" />
0550       </context>
0551 
0552       <!-- sema keyword -->
0553       <context name="sema_instruction" attribute="Normal Text" lineEndContext="#pop">
0554         <DetectIdentifier attribute="Sema Identifier" context="sema_identified" />
0555       </context>
0556       <context name="sema_identified" attribute="Normal Text" lineEndContext="#pop#pop">
0557         <StringDetect attribute="Keyword" String="sync" />
0558         <Int attribute="Decimal" context="#stay" />
0559         <IncludeRules context="comments" />
0560       </context>
0561 
0562       <!-- delay keyword -->
0563       <context name="delay_instruction" attribute="Normal Text" lineEndContext="#pop">
0564         <Float attribute="Float" context="#stay" />
0565         <Int attribute="Decimal" context="#stay" />
0566         <IncludeRules context="comments" />
0567       </context>
0568 
0569       <!-- feature keyword -->
0570       <context name="feature_instruction" attribute="String" lineEndContext="#pop">
0571         <IncludeRules context="strings" />
0572         <IncludeRules context="comments" />
0573       </context>
0574 
0575       <!-- chunkedlen keyword -->
0576       <context name="chunkedlen_instruction" attribute="Normal Text" lineEndContext="#pop">
0577         <Int attribute="Decimal" context="#stay" />
0578         <IncludeRules context="comments" />
0579       </context>
0580 
0581       <!-- send / sendhex / chunk keywords -->
0582       <context name="send_instruction" attribute="Normal Text" lineEndContext="#pop">
0583         <IncludeRules context="string-arg" />
0584         <IncludeRules context="comments" />
0585       </context>
0586 
0587       <!-- timeout keyword -->
0588       <context name="timeout_instruction" attribute="Normal Text" lineEndContext="#pop">
0589         <IncludeRules context="int-arg" />
0590         <IncludeRules context="comments" />
0591       </context>
0592 
0593       <!-- loop keyword at global scope -->
0594       <context name="global_loop_instruction" attribute="Normal Text" lineEndContext="#stay">
0595         <Int attribute="Decimal" context="global_loop_defined" />
0596       </context>
0597       <context name="global_loop_defined" attribute="Normal Text" lineEndContext="#stay">
0598         <DetectChar attribute="Region Marker" context="global_loop_code" char="{" beginRegion="loop_block" />
0599       </context>
0600       <context name="global_loop_code" attribute="Normal Text" lineEndContext="#stay">
0601         <DetectChar attribute="Region Marker" context="#pop#pop#pop" char="}" endRegion="loop_block" />
0602         <IncludeRules context="global_directives" />
0603       </context>
0604 
0605       <!-- loop keyword for client definitions -->
0606       <context name="client_loop_instruction" attribute="Normal Text" lineEndContext="#stay">
0607         <Int attribute="Decimal" context="client_loop_defined" />
0608       </context>
0609       <context name="client_loop_defined" attribute="Normal Text" lineEndContext="#stay">
0610         <DetectChar attribute="Region Marker" context="client_loop_code" char="{" beginRegion="loop_block" />
0611       </context>
0612       <context name="client_loop_code" attribute="Normal Text" lineEndContext="#stay">
0613         <DetectChar attribute="Region Marker" context="#pop#pop#pop" char="}" endRegion="loop_block" />
0614         <IncludeRules context="client_definition" />
0615       </context>
0616 
0617       <!-- loop keyword for server definitions -->
0618       <context name="server_loop_instruction" attribute="Normal Text" lineEndContext="#stay">
0619         <Int attribute="Decimal" context="server_loop_defined" />
0620       </context>
0621       <context name="server_loop_defined" attribute="Normal Text" lineEndContext="#stay">
0622         <DetectChar attribute="Region Marker" context="server_loop_code" char="{" beginRegion="loop_block" />
0623       </context>
0624       <context name="server_loop_code" attribute="Normal Text" lineEndContext="#stay">
0625         <DetectChar attribute="Region Marker" context="#pop#pop#pop" char="}" endRegion="loop_block" />
0626         <IncludeRules context="server_definition" />
0627       </context>
0628 
0629       <!-- shell keyword, one-line version -->
0630       <context name="shell_instruction" attribute="Normal Text" lineEndContext="#stay">
0631         <DetectChar attribute="Region Marker" context="shell_code" char="{" beginRegion="shell_block" />
0632         <IncludeRules context="quoted-strings" />
0633         <IncludeRules context="comments" />
0634       </context>
0635       <context name="shell_code" attribute="Normal Text" lineEndContext="#stay" fallthroughContext="Command##Bash">
0636         <DetectChar attribute="Region Marker" context="#pop#pop" char="}" endRegion="shell_block" />
0637         <!-- There does not seem to be a syntax highlighting dedicated to "standard shell" so let's use Bash instead -->
0638         <IncludeRules context="##Bash" />
0639       </context>
0640     </contexts>
0641     <itemDatas>
0642       <itemData name="Normal Text"               defStyleNum="dsNormal" />
0643       <itemData name="Comment"                   defStyleNum="dsComment" />
0644       <itemData name="Keyword"                   defStyleNum="dsKeyword" />
0645       <itemData name="Tx Keyword"                defStyleNum="dsOthers" /> <!-- #008000 -->
0646       <itemData name="TxReq Keyword"             defStyleNum="dsOthers" /> <!-- #008000 -->
0647       <itemData name="TxResp Keyword"            defStyleNum="dsOthers" /> <!-- #008000 -->
0648       <itemData name="RxResp Keyword"            defStyleNum="dsOthers" /> <!-- #008000 -->
0649       <itemData name="Action Keyword"            defStyleNum="dsKeyword" />
0650       <itemData name="Comparison Operator"       defStyleNum="dsOthers" /> <!-- #008000 -->
0651       <itemData name="Logical Operator"          defStyleNum="dsOthers" /> <!-- #008000 -->
0652       <itemData name="String"                    defStyleNum="dsString" />
0653       <itemData name="Region Marker"             defStyleNum="dsNormal" />
0654       <itemData name="HTTP Property"             defStyleNum="dsAttribute" bold="0" italic="0" /> <!-- #0000FF -->
0655       <itemData name="HTTP Header"               defStyleNum="dsExtension" bold="0" italic="0" /> <!-- #0D62FF -->
0656       <itemData name="HTTP X- Header"            defStyleNum="dsExtension" bold="0" italic="1" /> <!-- #0D62FF -->
0657       <itemData name="HTTP announce"             defStyleNum="dsFunction" bold="1" /> <!-- #562579 -->
0658       <itemData name="HTTP method"               defStyleNum="dsFunction" bold="1" /> <!-- #562579 -->
0659       <itemData name="HTTP WebDAV method"        defStyleNum="dsFunction" bold="1" /> <!-- #562579 -->
0660       <itemData name="HTTP custom method"        defStyleNum="dsFunction" bold="1" /> <!-- #562579 -->
0661       <itemData name="VarnishStat metric"        defStyleNum="dsAttribute" bold="0" italic="0" /> <!-- #0000FF -->
0662       <itemData name="VSL Tag"                   defStyleNum="dsAttribute" bold="0" italic="0" /> <!-- #0000FF -->
0663       <itemData name="VSL Grouping"              defStyleNum="dsAttribute" bold="0" italic="0" /> <!-- #0000FF -->
0664       <itemData name="Decimal"                   defStyleNum="dsDecVal" />
0665       <itemData name="Float"                     defStyleNum="dsFloat" spellChecking="false"/>
0666       <itemData name="Client Identifier"         defStyleNum="dsExtension" bold="0" underline="1" /> <!-- #0D62FF -->
0667       <itemData name="Server Identifier"         defStyleNum="dsExtension" bold="0" underline="1" /> <!-- #0D62FF -->
0668       <itemData name="Varnish Identifier"        defStyleNum="dsExtension" bold="0" underline="1" /> <!-- #0D62FF -->
0669       <itemData name="LogExpect Identifier"      defStyleNum="dsExtension" bold="0" underline="1" /> <!-- #0D62FF -->
0670       <itemData name="Sema Identifier"           defStyleNum="dsExtension" bold="0" underline="1" /> <!-- #0D62FF -->
0671     </itemDatas>
0672   </highlighting>
0673   <general>
0674     <comments>
0675       <comment name="singleLine" start="#" />
0676     </comments>
0677     <keywords casesensitive="1" />
0678   </general>
0679 </language>
0680 <!-- kate: space-indent on; indent-width 2; replace-tabs on; -->