Warning, /frameworks/syntax-highlighting/data/syntax/haml.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="Haml" version="14" kateversion="5.63" section="Markup"
0004           extensions="*.haml"
0005           author="Cies Breijs (cies_at_kde_nl)" license="LGPL"
0006           mimetype="text/x-haml">
0007 <!--      mimetype="text/x-haml"     this might be a problem as is doesn't exist -->
0008 
0009 <!-- learned and copied a lot from rhtml.xml -->
0010 <!-- ripped out some functionality from rhtml, like GDL, maybe put this back in some day... -->
0011 <!-- rhtml is rails specific, i ripped the rails helper keywords out as i'm a _merb_ guy... -->
0012 
0013 <!-- 1.1: fixed many many many buggers, clearly shows how arbitrary the title '1.0' was -->
0014 
0015 <!-- TODO: multi-line-based-on-indenting (comments, filters) don't work, mark more errors with error_hl_test.haml(?) (currently only unpaired spaces on indentation), give ruby code a little background, pipe character as a multiline splitter can use a little color (can it be escaped? "\|"), use hamls unittests for inspiration for better *_test.haml files -->
0016 
0017   <highlighting>
0018     <contexts>
0019       <context attribute="Normal Text" lineEndContext="#stay" name="normal" >
0020         <RegExpr attribute="Error" firstNonSpace="false" context="#stay" String="^ (  )*[^ ]+" column="0" />
0021         <StringDetect attribute="Doctype" context="Doctype" String="!!!" column="0"/>
0022 
0023 <!--         2 failed attempts to implement multiline comments -->
0024 
0025 <!--        <RegExpr attribute="Comment" String="/.*$" context="#stay" beginRegion="comment0" column="0"/>
0026         <RegExpr attribute="Comment" String="[^ /]" context="#stay" endRegion="comment0" column="0"/>
0027 
0028         <RegExpr attribute="Comment" String="^[ ]{2}/.*$" context="#stay" beginRegion="comment2" column="0"/>
0029         <RegExpr attribute="Comment" String="^[^ ]{4}" context="#stay" endRegion="comment2" column="0"/>-->
0030 
0031 <!--        <RegExpr attribute="Comment" context="comment0" String="^/.*" />
0032         <RegExpr attribute="Comment" context="comment2" String="^[ ]{2}/.*" />
0033         <RegExpr attribute="Comment" context="comment4" String="^[ ]{4}/.*" />-->
0034 
0035         <!-- match filters for special syntax highlighting before detecting spaces so we know how far we need to indent -->
0036         <IncludeRules context="Detect filter" />
0037 
0038         <DetectChar attribute="Escaped Text" context="escaped" char="\" />
0039         <DetectChar attribute="Comment" context="comment" char="/" />
0040 
0041         <Detect2Chars attribute="Keyword" context="unquoted" char="=" char1="=" />
0042         <AnyChar attribute="Keyword" context="rubysourceline" String="=-~" />
0043         <Detect2Chars attribute="Keyword" context="rubysourceline" char="!" char1="=" />
0044         <Detect2Chars attribute="Keyword" context="rubysourceline" char="&amp;" char1="=" />
0045 
0046         <!-- HAML can do Ruby substitution anywhere in the template -->
0047         <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
0048 
0049         <DetectChar attribute="Operator" context="array" char="[" beginRegion="Array" />
0050         <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" />
0051 
0052         <RegExpr attribute="Tag" firstNonSpace="true" context="#stay" String="%[a-zA-Z_][a-zA-Z0-9_\-]*" />
0053         <RegExpr attribute="Div Id" firstNonSpace="true" context="#stay" String="#[a-zA-Z_][a-zA-Z0-9_\-]*" />
0054         <RegExpr attribute="Div Class" firstNonSpace="true" context="#stay" String="\.[a-zA-Z_][a-zA-Z0-9_\-]*" />
0055         <RegExpr attribute="Element Id" context="#stay" String="#[a-zA-Z_][a-zA-Z0-9_\-]*" />
0056         <RegExpr attribute="Element Class" context="#stay" String="\.[a-zA-Z_][a-zA-Z0-9_\-]*" />
0057         <RegExpr attribute="Entity" context="#stay" String="&amp;[a-zA-Z]+;" />
0058       </context>
0059 
0060       <context attribute="Normal Text" lineEndContext="#pop" name="Detect filter">
0061         <RegExpr attribute="Filter" column="0" context="filterRuby" String="^(\s*):ruby\b" />
0062         <RegExpr attribute="Filter" column="0" context="filterCSS" String="^(\s*):css\b" />
0063         <RegExpr attribute="Filter" column="0" context="filterCoffeeScript" String="^(\s*):coffee(?:script)?\b" />
0064         <RegExpr attribute="Filter" column="0" context="filterERB" String="^(\s*):erb\b" />
0065         <RegExpr attribute="Filter" column="0" context="filterPlain" String="^(\s*):[a-zA-Z0-9_\-]*\b" />
0066         <DetectSpaces context="#pop#pop!normal" />
0067       </context>
0068 
0069       <context attribute="Normal Text" lineEndContext="#stay" name="filterRuby">
0070         <!-- detect base indentation + 1 whitespace for code -->
0071         <StringDetect context="rubysourceline" String="%1 " dynamic="true" />
0072         <!-- any other indentation means we're done here -->
0073         <IncludeRules context="Detect filter" />
0074       </context>
0075 
0076       <context attribute="Normal Text" lineEndContext="#stay" name="filterCoffeeScript">
0077         <!-- detect base indentation + 1 whitespace for code -->
0078         <StringDetect context="coffeesourceline" String="%1 " dynamic="true" />
0079         <!-- any other indentation means we're done here -->
0080         <IncludeRules context="Detect filter" />
0081       </context>
0082 
0083       <context attribute="Normal Text" lineEndContext="#stay" name="filterCSS">
0084         <!-- detect base indentation + 1 whitespace for code -->
0085         <StringDetect context="csssourceline" String="%1 " dynamic="true" />
0086         <!-- any other indentation means we're done here -->
0087         <IncludeRules context="Detect filter" />
0088       </context>
0089 
0090       <context attribute="Normal Text" lineEndContext="#stay" name="filterERB">
0091         <!-- detect base indentation + 1 whitespace for code -->
0092         <StringDetect context="erbsourceline" String="%1 " dynamic="true" />
0093         <!-- any other indentation means we're done here -->
0094         <IncludeRules context="Detect filter" />
0095       </context>
0096 
0097       <context attribute="Normal Text" lineEndContext="#stay" name="filterPlain">
0098         <!-- detect base indentation + 1 whitespace for code -->
0099         <StringDetect context="plainsourceline" String="%1 " dynamic="true" />
0100         <!-- any other indentation means we're done here -->
0101         <IncludeRules context="Detect filter" />
0102       </context>
0103 
0104       <context attribute="Operator" lineEndContext="#stay" name="array">
0105         <DetectSpaces/>
0106         <DetectChar attribute="Operator" context="#pop" char="]" endRegion="Array" />
0107         <IncludeRules context="rubysourceline" />
0108       </context>
0109 
0110       <context attribute="Hash" lineEndContext="#stay" name="hash">
0111         <DetectSpaces/>
0112         <DetectChar attribute="Operator" context="#pop" char="}" endRegion="Hash" />
0113         <IncludeRules context="rubysourceline" />
0114       </context>
0115 
0116       <context attribute="Unquoted String" lineEndContext="#pop" name="unquoted">
0117         <IncludeRules context="Quoted String" />
0118       </context>
0119 
0120 <!--      <context attribute="Comment" lineEndContext="#pop" name="comment0">
0121         <DetectSpaces/>
0122         <IncludeRules context="##Comments" />
0123         <DetectIdentifier/>
0124 <!- - was commented out         <RegExpr attribute="Comment" context="#pop" String="^[^/ ]" endRegion="comment" />  attempt for multiline comments  - ->
0125       </context>
0126 -->
0127 <!--      <context attribute="Comment" lineEndContext="#pop" name="comment2">
0128         <DetectSpaces/>
0129         <IncludeRules context="##Comments" />
0130         <DetectIdentifier/>
0131         <RegExpr attribute="Comment" context="#pop" String="^[ ]{2}[^ /]" endRegion="comment" />
0132       </context>-->
0133 
0134 
0135       <context attribute="Comment" lineEndContext="#pop" name="comment">
0136         <DetectSpaces/>
0137         <IncludeRules context="##Comments" />
0138         <DetectIdentifier/>
0139         <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
0140       </context>
0141 
0142       <context attribute="Escaped Text" lineEndContext="#pop" name="escaped">
0143       </context>
0144 
0145       <context name="rubysourceline" attribute="Ruby embedded in haml" lineEndContext="#pop">
0146         <!-- ruby ignores newline after \ -->
0147         <LineContinue attribute="Ruby Normal Text" context="#stay"/>
0148         <!-- HAML allows lines ending with `,` to continue to the next line -->
0149         <LineContinue attribute="Ruby Normal Text" context="#stay" char="," />
0150 
0151         <IncludeRules context="##Ruby" />
0152       </context>
0153 
0154       <context name="csssourceline" attribute="Other code embedded in haml" lineEndContext="#pop">
0155         <IncludeRules context="##CSS" />
0156       </context>
0157 
0158       <context name="coffeesourceline" attribute="Other code embedded in haml" lineEndContext="#pop">
0159         <IncludeRules context="##CoffeeScript" />
0160       </context>
0161 
0162       <context name="erbsourceline" attribute="Other code embedded in haml" lineEndContext="#pop">
0163         <IncludeRules context="##Ruby/Rails/RHTML" />
0164       </context>
0165 
0166       <context name="plainsourceline" attribute="Other code embedded in haml" lineEndContext="#pop" />
0167 
0168       <context name="Quoted String" attribute="String" lineEndContext="#stay">
0169         <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/>
0170         <Detect2Chars attribute="String" char="\" char1="&quot;" context="#stay"/>
0171         <StringDetect attribute="Substitution" String="#@@" context="Short Subst"/>
0172         <Detect2Chars attribute="Substitution" char="#" char1="@" context="Short Subst"/>
0173         <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
0174         <!--HlCChar attribute="Char" context="#pop"/-->
0175         <DetectChar char="&quot;" attribute="String" context="#pop"/>
0176       </context>
0177 
0178       <!-- Substitutions can be nested -->
0179       <context name="Subst" attribute="Ruby Normal Text" lineEndContext="#stay">
0180         <DetectChar attribute="Substitution" char="}" context="#pop"/>
0181         <!-- Highlight substitution as code. -->
0182         <IncludeRules context="##Ruby"/>
0183       </context>
0184 
0185       <context name="Short Subst" attribute="Substitution" lineEndContext="#pop">
0186         <!-- Check for e.g.: "#@var#@@xy" -->
0187         <StringDetect attribute="Substitution" String="#@@" context="#stay"/>
0188         <Detect2Chars attribute="Substitution" char="#" char1="@" context="#stay"/>
0189         <RegExpr attribute="Substitution" String="\w(?!\w)" context="#pop"/>
0190       </context>
0191 
0192       <context name="Doctype" attribute="Doctype" lineEndContext="#pop"/>
0193     </contexts>
0194 
0195 
0196 
0197 
0198     <itemDatas>
0199     <!-- Ruby itemData -->
0200       <itemData name="Ruby Normal Text" defStyleNum="dsNormal"/>
0201       <itemData name="Ruby embedded in haml" defStyleNum="dsNormal"/>
0202       <itemData name="Other code embedded in haml" defStyleNum="dsNormal"/>
0203 
0204       <itemData name="Keyword" defStyleNum="dsKeyword"/>
0205 
0206       <itemData name="String" defStyleNum="dsString"/>
0207       <itemData name="Escaped Text" defStyleNum="dsChar"/>
0208       <itemData name="Unquoted String" defStyleNum="dsString"/>
0209       <itemData name="Substitution" defStyleNum="dsOthers"/>
0210 
0211       <!-- use these to mark errors and alerts things -->
0212       <itemData name="Error" defStyleNum="dsError" />
0213 
0214       <itemData name="Operator" defStyleNum="dsChar"/>
0215 
0216      <!-- HAML itemData -->
0217 
0218       <itemData name="Normal Text" defStyleNum="dsNormal" />
0219       <itemData name="Hash" defStyleNum="dsNormal" />
0220       <itemData name="Comment" defStyleNum="dsComment" />
0221       <itemData name="Doctype" defStyleNum="dsDataType" bold="1" />
0222       <itemData name="Filter" defStyleNum="dsOthers" />
0223       <itemData name="Element Id" defStyleNum="dsFloat" bold="1" />
0224       <itemData name="Element Class" defStyleNum="dsFloat" />
0225       <itemData name="Div Id" defStyleNum="dsDecVal" bold="1" />
0226       <itemData name="Div Class" defStyleNum="dsDecVal" />
0227       <itemData name="Tag" defStyleNum="dsKeyword" />
0228       <itemData name="Entity" defStyleNum="dsDecVal" />
0229     </itemDatas>
0230   </highlighting>
0231   <general>
0232     <folding indentationsensitive="1" />
0233     <emptyLines>
0234       <emptyLine regexpr="\s+"/>
0235     </emptyLines>
0236     <comments>
0237       <comment name="singleLine" start="/" position="afterwhitespace"/>
0238     </comments>
0239     <keywords casesensitive="1"/>
0240   </general>
0241 </language>
0242 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->