Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/elm.xml
- This file was added.
1 | <?xml version="1.0" encoding="UTF-8"?> | ||||
---|---|---|---|---|---|
2 | <!DOCTYPE language SYSTEM "language.dtd"> | ||||
3 | <language name="Elm" version="1" kateversion="5.0" section="Sources" extensions="*.elm" author="Bonghyun Kim (bonghyun.d.kim@gmail.com)" license="MIT" style="elm"> | ||||
4 | <highlighting> | ||||
5 | <list name="declarations"> | ||||
6 | <item>type</item> | ||||
7 | <item>alias</item> | ||||
8 | <item>port</item> | ||||
9 | </list> | ||||
10 | <list name="controlFlows"> | ||||
11 | <item>case</item> | ||||
12 | <item>of</item> | ||||
13 | <item>if</item> | ||||
14 | <item>else</item> | ||||
15 | <item>then</item> | ||||
16 | </list> | ||||
17 | <list name="letExpressions"> | ||||
18 | <item>let</item> | ||||
19 | <item>in</item> | ||||
20 | </list> | ||||
21 | <list name="imports"> | ||||
22 | <item>module</item> | ||||
23 | <item>exposing</item> | ||||
24 | <item>import</item> | ||||
25 | <item>as</item> | ||||
26 | </list> | ||||
27 | <list name="infixes"> | ||||
28 | <item>infix</item> | ||||
29 | <item>left</item> | ||||
30 | <item>right</item> | ||||
31 | <item>non</item> | ||||
32 | </list> | ||||
33 | <list name="effects"> | ||||
34 | <item>effect</item> | ||||
35 | <item>where</item> | ||||
36 | <item>command</item> | ||||
37 | <item>subscription</item> | ||||
38 | </list> | ||||
39 | <contexts> | ||||
40 | <context attribute="Normal" lineEndContext="#stay" name="code"> | ||||
41 | <Detect2Chars attribute="Comment" context="comments" char="{" char1="-" /> | ||||
42 | <Detect2Chars attribute="Comment" context="comment" char="-" char1="-" /> | ||||
43 | <WordDetect attribute="Comment" context="documentation" String="{-|" /> | ||||
44 | | ||||
45 | <keyword attribute="Keyword" context="#stay" String="declarations" /> | ||||
46 | <keyword attribute="Keyword" context="#stay" String="letExpressions" /> | ||||
47 | <keyword attribute="Keyword" context="#stay" String="effects" /> | ||||
48 | <keyword attribute="Keyword" context="#stay" String="imports" /> | ||||
49 | <keyword attribute="Keyword" context="#stay" String="infixes" /> | ||||
50 | <keyword attribute="ControlFlowKeyword" context="#stay" String="controlFlows" /> | ||||
51 | | ||||
52 | <WordDetect attribute="Import" context="module" String="module" /> | ||||
53 | <WordDetect attribute="Port" context="port" String="port" /> | ||||
54 | <WordDetect attribute="Import" context="import" String="import" /> | ||||
55 | | ||||
56 | <RegExpr attribute="Name" context="#stay" String="(\b[a-z]\w*|\b_\b)" /> | ||||
57 | <RegExpr attribute="Operator" context="#stay" String="(->|::|\/\/|\.\.|&&|\|\||\+\+|\|>|<\||>>|<<|==|\/=|<=|>=)" /> | ||||
58 | <RegExpr attribute="Operator" context="#stay" String="[+-\/*%=><^\|!]" /> | ||||
59 | <RegExpr attribute="Operator" context="#stay" String="[@\#$&~?]" /> | ||||
60 | | ||||
61 | <RegExpr attribute="Type" context="#stay" String="\b[A-Z][\w]*" /> | ||||
62 | | ||||
63 | <Int attribute="Decimal" context="#stay" /> | ||||
64 | <RegExpr attribute="Hex" context="#stay" String="0x[\da-f]+" insensitive="true" /> | ||||
65 | <RegExpr attribute="Float" context="#stay" String="\d+\.\d+(e[+-]?\d+)?" insensitive="true" /> | ||||
66 | | ||||
67 | <RegExpr attribute="Char" context="#stay" String="'(.|\\'|\\n|\\r|\\t|\\"|\\\\|\\u\{(10|0?[0-9])[0-9a-fA-F]{4}\})'" /> | ||||
68 | <DetectChar attribute="String" context="string" char=""" /> | ||||
69 | <RegExpr attribute="String" context="multilineString" String="""""/> | ||||
70 | </context> | ||||
71 | <context attribute="Comment" lineEndContext="#pop" name="comment"> | ||||
72 | </context> | ||||
73 | <context attribute="Comment" lineEndContext="#stay" name="comments"> | ||||
74 | <Detect2Chars attribute="Comment" context="comments" char="{" char1="-" /> | ||||
75 | <Detect2Chars attribute="Comment" context="#pop" char="-" char1="}" /> | ||||
76 | </context> | ||||
77 | <context attribute="String" lineEndContext="#stay" name="string"> | ||||
78 | <RegExpr attribute="String" context="#stay" String="\\." /> | ||||
79 | <DetectChar attribute="String" context="#pop" char=""" /> | ||||
80 | </context> | ||||
81 | <context attribute="String" lineEndContext="#stay" name="multilineString"> | ||||
82 | <RegExpr attribute="String" context="#stay" String="\s*" /> | ||||
83 | <RegExpr attribute="String" context="#stay" String="\.*" /> | ||||
84 | <StringDetect attribute="String" context="#pop" String=""""" /> | ||||
85 | </context> | ||||
86 | <context attribute="Normal" lineEndContext="#stay" name="module"> | ||||
87 | <DetectChar attribute="Normal" context="moduleParentheses" char="(" /> | ||||
88 | <keyword attribute="Keyword" context="#stay" String="imports" /> | ||||
89 | <RegExpr attribute="Name" context="#stay" String="\b[a-z][\w]*" /> | ||||
90 | <RegExpr attribute="Type" context="#stay" String="\b[A-Z][\w]*" /> | ||||
91 | <DetectChar attribute="Normal" context="#pop" char=")" /> | ||||
92 | </context> | ||||
93 | <context attribute="Normal" lineEndContext="#stay" name="moduleParentheses"> | ||||
94 | <DetectChar attribute="Normal" context="moduleParentheses" char="(" /> | ||||
95 | <RegExpr attribute="Name" context="#stay" String="\b[a-z][\w]*" /> | ||||
96 | <RegExpr attribute="Type" context="#stay" String="\b[A-Z][\w]*" /> | ||||
97 | <DetectChar attribute="Normal" context="#pop" char=")" /> | ||||
98 | </context> | ||||
99 | <context attribute="Normal" lineEndContext="#stay" name="port"> | ||||
100 | <WordDetect attribute="Import" context="module" String="imports" /> | ||||
101 | </context> | ||||
102 | <context attribute="Normal" lineEndContext="#stay" name="import"> | ||||
103 | <DetectChar attribute="Normal" context="moduleParentheses" char="(" /> | ||||
104 | <keyword attribute="Keyword" context="#stay" String="imports" /> | ||||
105 | <RegExpr attribute="Name" context="#stay" String="\b[a-z][\w]*" /> | ||||
106 | <RegExpr attribute="Type" context="#stay" String="\b[A-Z][\w]*" /> | ||||
107 | <DetectChar attribute="Normal" context="#pop" char=")" /> | ||||
108 | </context> | ||||
109 | <context attribute="Comment" lineEndContext="#stay" name="documentation"> | ||||
110 | <WordDetect attribute="Comment" context="#stay" String="@docs" /> | ||||
111 | <Detect2Chars attribute="Comment" context="#pop" char="-" char1="}" /> | ||||
112 | </context> | ||||
113 | </contexts> | ||||
114 | | ||||
115 | <itemDatas> | ||||
116 | <itemData name="Normal" defStyleNum="dsNormal" spellChecking="false" /> | ||||
117 | <itemData name="Comment" defStyleNum="dsComment" /> | ||||
118 | | ||||
119 | <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false" /> | ||||
120 | <itemData name="ControlFlowKeyword" defStyleNum="dsControlFlow" spellChecking="false" /> | ||||
121 | | ||||
122 | <itemData name="Name" defStyleNum="dsFunction" spellChecking="false" /> | ||||
123 | <itemData name="Port" defStyleNum="dsNormal" spellChecking="false" /> | ||||
124 | <itemData name="Import" defStyleNum="dsImport" spellChecking="false" /> | ||||
125 | <itemData name="Operator" defStyleNum="dsOperator" spellChecking="false" /> | ||||
126 | <itemData name="Type" defStyleNum="dsDataType" spellChecking="false" /> | ||||
127 | | ||||
128 | <itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false" /> | ||||
129 | <itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false" /> | ||||
130 | <itemData name="Float" defStyleNum="dsFloat" spellChecking="false" /> | ||||
131 | <itemData name="Char" defStyleNum="dsChar" spellChecking="false" /> | ||||
132 | <itemData name="String" defStyleNum="dsString" /> | ||||
133 | </itemDatas> | ||||
134 | </highlighting> | ||||
135 | <general> | ||||
136 | <folding indentationsensitive="1"/> | ||||
137 | <comments> | ||||
138 | <comment name="singleLine" start="--" /> | ||||
139 | <comment name="multiLine" start="{-" end="-}" /> | ||||
140 | </comments> | ||||
141 | <keywords casesensitive="1" /> | ||||
142 | </general> | ||||
143 | </language> |