1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language [
<!ENTITY name "[A-Za-z][A-Za-z0-9_-]*">
<!ENTITY voidtag "(area|base|br|col|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)">
<!ENTITY entity "&(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9_-]*);">
]>
<!--
Pug, known as Jade before, is a HTML template engine.
https://pugjs.org/
Changelog
Version 1 - Guo Yunhe guoyunhebrave@gmail.com - 2017-04-14
- Basic Pug/Jade syntax support
- Do NOT support multi-line comment or text block
-->
<language name="Pug" version="8" kateversion="5.53" section="Markup" extensions="*.pug;*.jade" mimetype="" priority="10" author="Guo Yunhe (guoyunhebrave@gmail.com)" license="LGPL">
<highlighting>
<list name="controlflow">
<item>case</item>
<item>when</item>
<item>default</item>
<item>if</item>
<item>unless</item>
<item>else</item>
<item>each</item>
<item>while</item>
</list>
<contexts>
<context name="Start" attribute="Normal Text" lineEndContext="#stay">
<RegExpr attribute="Comment" context="BlockComment" String="^(\s*)//" column="0"/>
<Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
<StringDetect attribute="Doctype" context="#stay" String="doctype" insensitive="true"/>
<RegExpr attribute="ControlFlow" context="JavaScript" String="\belse\s+if\b" firstNonSpace="true"/>
<keyword attribute="ControlFlow" context="JavaScript" String="controlflow" firstNonSpace="true"/>
<DetectIdentifier attribute="Normal Text" context="Element" firstNonSpace="true" lookAhead="true"/>
<AnyChar attribute="Normal Text" context="Element" String="#." firstNonSpace="true" lookAhead="true"/>
<DetectChar attribute="Normal Text" context="JavaScript" char="-" firstNonSpace="true"/>
<DetectChar attribute="Normal Text" context="#stay" char="|" firstNonSpace="true"/>
</context>
<context name="FindInterpolation" attribute="Normal Text" lineEndContext="#stay">
<Detect2Chars attribute="Interpolation" context="JavaScript" char="#" char1="{"/>
<DetectChar attribute="Interpolation" context="#stay" char="}"/>
</context>
<context name="FindEntities" attribute="Normal Text" lineEndContext="#stay">
<RegExpr attribute="Entity" context="#stay" String="&entity;"/>
<AnyChar attribute="Error" context="#stay" String="&<"/>
</context>
<context name="Element" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Element" context="#stay" String="&name;"/>
<RegExpr attribute="ID" context="#stay" String="#&name;"/>
<RegExpr attribute="Class" context="#stay" String="\.&name;"/>
<DetectChar attribute="Normal Text" context="Attributes" char="("/>
<StringDetect attribute="Normal Text" context="AttributeObject" String="&attributes("/>
<RegExpr attribute="Normal Text" context="Element" String=":\s+"/>
<RegExpr attribute="Normal Text" context="JavaScript" String="=\s+"/>
<DetectChar attribute="Normal Text" context="Text" char=" "/>
</context>
<context name="Attributes" attribute="Normal Text" lineEndContext="#stay">
<RegExpr attribute="Attribute" context="Attribute" String="(&name;|\(&name;\))"/>
<DetectChar attribute="Normal Text" context="#pop" char=")"/>
</context>
<context name="AttributeObject" attribute="Normal Text" lineEndContext="#stay">
<DetectChar attribute="Normal Text" context="#pop" char=")"/>
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/>
</context>
<context name="Attribute" attribute="Attribute" lineEndContext="#pop">
<AnyChar attribute="Normal Text" context="#pop" String=",)" lookAhead="true"/>
<RegExpr attribute="Attribute" context="#pop" String="\s+(&name;|\(&name;\))(=|\s|\))" lookAhead="true"/>
<DetectChar attribute="Attribute" context="Value" char="="/>
</context>
<context name="Value" attribute="Normal Text" lineEndContext="#pop">
<AnyChar attribute="Normal Text" context="#pop" String=",)" lookAhead="true"/>
<RegExpr attribute="Attribute" context="#pop" String="\s+(&name;|\(&name;\))(=|\s|\))" lookAhead="true"/>
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/>
</context>
<context name="Text" attribute="Normal Text" lineEndContext="#pop">
<DetectSpaces/>
<IncludeRules context="FindEntities" includeAttrib="true"/>
<IncludeRules context="FindInterpolation" includeAttrib="true"/>
</context>
<context name="JavaScript" attribute="Normal Text" lineEndContext="#pop">
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/>
<AnyChar attribute="Normal Text" context="#pop" String=",)}:" lookAhead="true"/>
</context>
<context name="Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<IncludeRules context="##Comments"/>
</context>
<context name="BlockComment" attribute="Comment" lineEndContext="#stay">
<RegExpr attribute="Comment" context="#stay" String="^%1\s" column="0" dynamic="true"/>
<RegExpr attribute="Comment" context="#stay" String="^\s*$" column="0"/>
<RegExpr attribute="Comment" context="#pop" String="." lookAhead="true" column="0"/>
<IncludeRules context="Comment"/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="ControlFlow" defStyleNum="dsControlFlow" spellChecking="false"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Doctype" defStyleNum="dsDataType" bold="1" spellChecking="false"/>
<itemData name="Element" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="ID" defStyleNum="dsPreprocessor" spellChecking="false"/>
<itemData name="Class" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Attribute" defStyleNum="dsAttribute" spellChecking="false"/>
<itemData name="Entity" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Interpolation" defStyleNum="dsPreprocessor" spellChecking="false"/>
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/>
</itemDatas>
</highlighting>
<general>
<keywords casesensitive="1" weakDeliminator="-"/>
<comments>
<comment name="singleLine" start="//" position="afterwhitespace"/>
</comments>
<folding indentationsensitive="1"/>
<emptyLines>
<emptyLine regexpr="\s+"/>
<emptyLine regexpr="\s*//.*"/>
</emptyLines>
</general>
</language>
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->
|