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
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language
[
<!-- In EBNF: Identifier ::= [a-zA-Z] [a-zA-Z0-9_-]*-->
<!ENTITY identifier "[a-zA-Z0-9_-]">
<!ENTITY number "-?\d+(?:\.\d+)?">
<!ENTITY variant_key "\[(?:&identifier;+|(?:&number;))\]">
<!ENTITY hex "[0-9a-fA-F]">
]>
<language name="Fluent" version="1" kateversion="5.0" section="Markup" extensions="*.ftl" mimetype="text/x-fluent-translation" author="Fabian Wunsch (fabian@uriah.heep.sax.de)" license="MIT" priority="-1">
<highlighting>
<contexts>
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
<StringDetect String="###" context="FileComment" column="0"/>
<Detect2Chars char="#" char1="#" context="StandaloneComment" column="0"/>
<DetectChar char="#" context="MessageComment" column="0"/>
<RegExpr String="^(&identifier;+)" context="Identifier" column="0"/>
<DetectSpaces/>
</context>
<context name="Identifier" attribute="Identifier" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!Error">
<RegExpr String="\s*=\s*" context="MultiLineText" attribute="Normal Text"/>
</context>
<context name="AttributeIdentifier" attribute="Identifier" lineEndContext="#pop">
<RegExpr String="\s*=\s*" context="#pop#pop!MultiLineText" attribute="Normal Text"/>
<DetectChar char=" " context="#pop#pop!Error"/>
</context>
<context name="Error" attribute="Error" lineEndContext="#pop">
</context>
<context name="MessageComment" attribute="Comment" lineEndContext="#pop">
<IncludeRules context="##Comments"/>
</context>
<context name="StandaloneComment" attribute="DocumentationComment" lineEndContext="#pop">
<IncludeRules context="MessageComment"/>
</context>
<context name="FileComment" attribute="DocumentationComment" lineEndContext="#pop">
<IncludeRules context="MessageComment"/>
</context>
<context name="SingleLineText" attribute="Text" lineEndContext="#pop">
<DetectIdentifier/>
<DetectChar char="{" context="Placeable"/>
</context>
<context name="MultiLineText" attribute="Text" lineEndContext="#stay">
<DetectSpaces/>
<RegExpr String="^[^ ]" context="#pop#pop" column="0" lookAhead="true"/>
<RegExpr String="(?<=[ ])(?:\.&identifier;)" context="AttributeIdentifier" lookAhead="true"/>
<IncludeRules context="SingleLineText"/>
</context>
<context name="Expression" lineEndContext="#pop" attribute="Normal Text">
<DetectChar char=""" context="Quoted"/>
<RegExpr String="&number;" attribute="Number"/>
<RegExpr String="(?:&identifier;+\s*\()" context="Function"/>
<RegExpr String="(?:\$&identifier;+)" attribute="Variable"/>
<RegExpr String="(?:&identifier;+(?:\.&identifier;+)?)"/>
<DetectChar char="{" context="Placeable"/>
</context>
<context name="Placeable" attribute="Placeable" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!Error">
<DetectSpaces/>
<DetectChar char="}" context="#pop" attribute="Placeable"/>
<RegExpr String="(?:\*&variant_key;)" context="SingleLineText" attribute="DefaultIdentifier"/>
<RegExpr String="(?:&variant_key;)" context="SingleLineText" attribute="Identifier"/>
<Detect2Chars char="-" char1=">"/>
<IncludeRules context="Expression"/>
</context>
<context name="Function" attribute="Function" lineEndContext="#pop!Error" fallthrough="true" fallthroughContext="#pop!Error">
<DetectSpaces/>
<DetectChar char=")" context="#pop" attribute="Function"/>
<RegExpr String="(?:&identifier;+\s*:\s*)"/>
<DetectChar char=","/>
<IncludeRules context="Expression"/>
</context>
<context name="Quoted" attribute="Quoted" lineEndContext="#pop!Error">
<DetectIdentifier/>
<RegExpr String="\\(?:"|\\|u&hex;{4}|U&hex;{6})"/>
<DetectChar char="\" context="#pop!Error"/>
<DetectChar char=""" context="#pop" attribute="Quoted"/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/>
<itemData name="Identifier" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="DefaultIdentifier" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Text" defStyleNum="dsString" spellChecking="true"/>
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Placeable" defStyleNum="dsSpecialChar" spellChecking="false"/>
<itemData name="Comment" defStyleNum="dsComment" spellChecking="true"/>
<itemData name="DocumentationComment" defStyleNum="dsDocumentation" spellChecking="true"/>
<itemData name="Quoted" defStyleNum="dsString" spellChecking="true"/>
<itemData name="Variable" defStyleNum="dsVariable" spellChecking="false"/>
<itemData name="Number" defStyleNum="dsDecVal" spellChecking="false"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="#"/>
</comments>
<folding indentationsensitive="true"/>
</general>
</language>
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->
|