forked from dhotson/coffeescript-jedit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coffeescript.xml
210 lines (181 loc) · 6.02 KB
/
coffeescript.xml
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?xml version="1.0"?>
<!DOCTYPE MODE SYSTEM "xmode.dtd">
<!-- CoffeeScript mode by Dennis Hotson, Balazs Toth
Beta
TODO:
- reconsider (un)indentation rules for brackets
-->
<MODE>
<PROPS>
<PROPERTY NAME="commentStart" VALUE="###" />
<PROPERTY NAME="commentEnd" VALUE="###" />
<PROPERTY NAME="lineComment" VALUE="#" />
<PROPERTY NAME="wordBreakChars" VALUE=",+-=<>/?^&*" />
<!-- Auto indent -->
<PROPERTY NAME="indentNextLines"
VALUE="((\s*|.*\s+)([\-=]>|[\+\-\*/%\\<>=\!&\|\^~]|(.*:|<<|>>|>>>|\+=|\-=|\*=|/=|%=|<=|>=|==|===|\!=|\!==|is|isnt|not|and|or|&&|\|\||of|in))|\s*(if|else|try|catch|finally|class|while|until|for)(\s*|\s+.*))\s*" />
<PROPERTY NAME="unindentThisLine" VALUE="^\s*(else|catch|finally)(\s*|\s+.*)$" />
<PROPERTY NAME="unindentNextLines" VALUE="^\s*(else|catch|finally)(\s*|\s+.*)$" />
<!-- Props regarding brackets generally do not play well with CoffeScript -->
<!-- Triggers reindentation on character input.
TODO: reconsider the use of this one, including "ehy" -->
<!-- PROPERTY NAME="electricKeys" VALUE="}])" /-->
<!-- Originally designed for Python, does not work correctly with CS -->
<!-- PROPERTY NAME="ignoreWhitespace" VALUE="false" /-->
</PROPS>
<RULES
IGNORE_CASE="FALSE"
HIGHLIGHT_DIGITS="TRUE"
DIGIT_RE="(0[xX][0-9a-fA-F]+)|([0-9]+(\.[0-9]+)?([eE][+\-]?[0-9]+)?)">
<SPAN TYPE="COMMENT2">
<BEGIN>###</BEGIN>
<END>###</END>
</SPAN>
<EOL_SPAN TYPE="COMMENT1">#</EOL_SPAN>
<SPAN TYPE="LITERAL1" NO_LINE_BREAK="FALSE" ESCAPE="\" DELEGATE="doubleQuoteLiteral">
<BEGIN>"""</BEGIN>
<END>"""</END>
</SPAN>
<SPAN TYPE="LITERAL2" NO_LINE_BREAK="FALSE" ESCAPE="\">
<BEGIN>'''</BEGIN>
<END>'''</END>
</SPAN>
<SPAN TYPE="LITERAL1" NO_LINE_BREAK="FALSE" ESCAPE="\" DELEGATE="doubleQuoteLiteral">
<BEGIN>"</BEGIN>
<END>"</END>
</SPAN>
<SPAN TYPE="LITERAL2" NO_LINE_BREAK="FALSE" ESCAPE="\">
<BEGIN>'</BEGIN>
<END>'</END>
</SPAN>
<SPAN TYPE="LITERAL1" DELEGATE="javascript::MAIN">
<BEGIN>`</BEGIN>
<END>`</END>
</SPAN>
<!-- Javascript-style regexps -->
<SEQ_REGEXP TYPE="MARKUP">(?<!\d)\s*/(?![\s/*+{}?]).*/[igmy]*</SEQ_REGEXP>
<!-- Heregexps -->
<SPAN TYPE="MARKUP" DELEGATE="hereRegexp">
<BEGIN>///</BEGIN>
<END>///</END>
</SPAN>
<MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS>
<!-- Seems to be equivalent to
SEQ_REGEXP TYPE="FUNCTION">([a-zA-Z\$_](\w|\$)*)(?=\s*\()</SEQ_REGEXP -->
<SEQ TYPE="OPERATOR">)</SEQ>
<SEQ TYPE="OPERATOR">{</SEQ>
<SEQ TYPE="OPERATOR">}</SEQ>
<SEQ TYPE="OPERATOR">[</SEQ>
<SEQ TYPE="OPERATOR">]</SEQ>
<SEQ TYPE="OPERATOR">.</SEQ>
<SEQ TYPE="OPERATOR">+</SEQ>
<SEQ TYPE="OPERATOR">/</SEQ>
<SEQ TYPE="OPERATOR">*</SEQ>
<SEQ TYPE="OPERATOR">&</SEQ>
<SEQ TYPE="OPERATOR">|</SEQ>
<SEQ TYPE="OPERATOR">\</SEQ>
<SEQ TYPE="OPERATOR">-</SEQ>
<SEQ TYPE="OPERATOR">%</SEQ>
<SEQ TYPE="OPERATOR">=</SEQ>
<SEQ TYPE="OPERATOR"><</SEQ>
<SEQ TYPE="OPERATOR">></SEQ>
<SEQ TYPE="OPERATOR">:</SEQ>
<SEQ TYPE="OPERATOR">!</SEQ>
<SEQ TYPE="OPERATOR">;</SEQ>
<SEQ TYPE="OPERATOR">^</SEQ>
<SEQ TYPE="OPERATOR">~</SEQ>
<SEQ TYPE="OPERATOR">?</SEQ>
<SEQ_REGEXP TYPE="KEYWORD3">@([a-zA-Z\$_](\w|\$)*)</SEQ_REGEXP>
<SEQ_REGEXP TYPE="KEYWORD4">([a-zA-Z\$_](\w|\$)*)(?=\s*[:\.])</SEQ_REGEXP>
<KEYWORDS>
<KEYWORD3>this</KEYWORD3>
<KEYWORD3>super</KEYWORD3>
<KEYWORD1>if</KEYWORD1>
<KEYWORD1>else</KEYWORD1>
<KEYWORD1>new</KEYWORD1>
<KEYWORD1>return</KEYWORD1>
<KEYWORD1>try</KEYWORD1>
<KEYWORD1>catch</KEYWORD1>
<KEYWORD1>finally</KEYWORD1>
<KEYWORD1>throw</KEYWORD1>
<KEYWORD1>break</KEYWORD1>
<KEYWORD1>continue</KEYWORD1>
<KEYWORD1>for</KEYWORD1>
<KEYWORD1>in</KEYWORD1>
<KEYWORD1>while</KEYWORD1>
<KEYWORD1>delete</KEYWORD1>
<KEYWORD1>instanceof</KEYWORD1>
<KEYWORD1>typeof</KEYWORD1>
<KEYWORD1>switch</KEYWORD1>
<KEYWORD1>extends</KEYWORD1>
<KEYWORD1>class</KEYWORD1>
<KEYWORD1>constructor</KEYWORD1>
<KEYWORD1>case</KEYWORD1>
<KEYWORD1>default</KEYWORD1>
<KEYWORD1>do</KEYWORD1>
<KEYWORD1>function</KEYWORD1>
<KEYWORD1>var</KEYWORD1>
<KEYWORD1>void</KEYWORD1>
<KEYWORD1>with</KEYWORD1>
<KEYWORD1>const</KEYWORD1>
<KEYWORD1>let</KEYWORD1>
<KEYWORD1>enum</KEYWORD1>
<KEYWORD1>export</KEYWORD1>
<KEYWORD1>import</KEYWORD1>
<KEYWORD1>native</KEYWORD1>
<KEYWORD1>then</KEYWORD1>
<KEYWORD1>unless</KEYWORD1>
<KEYWORD1>until</KEYWORD1>
<KEYWORD1>of</KEYWORD1>
<KEYWORD1>by</KEYWORD1>
<KEYWORD1>where</KEYWORD1>
<KEYWORD1>when</KEYWORD1>
<KEYWORD1>and</KEYWORD1>
<KEYWORD1>or</KEYWORD1>
<KEYWORD1>not</KEYWORD1>
<KEYWORD1>is</KEYWORD1>
<KEYWORD1>isnt</KEYWORD1>
<KEYWORD3>prototype</KEYWORD3>
<KEYWORD3>Array</KEYWORD3>
<KEYWORD3>Boolean</KEYWORD3>
<KEYWORD3>Date</KEYWORD3>
<KEYWORD3>Function</KEYWORD3>
<KEYWORD3>Global</KEYWORD3>
<KEYWORD3>Math</KEYWORD3>
<KEYWORD3>Number</KEYWORD3>
<KEYWORD3>Object</KEYWORD3>
<KEYWORD3>RegExp</KEYWORD3><!-- Not ECMA -->
<KEYWORD3>String</KEYWORD3>
<!-- Literals -->
<LITERAL2>false</LITERAL2>
<LITERAL2>null</LITERAL2>
<LITERAL2>true</LITERAL2>
<LITERAL2>yes</LITERAL2>
<LITERAL2>no</LITERAL2>
<LITERAL2>on</LITERAL2>
<LITERAL2>off</LITERAL2>
<LITERAL2>NaN</LITERAL2>
<LITERAL2>Infinity</LITERAL2>
<!-- Global functions -->
<LITERAL2>eval</LITERAL2>
<LITERAL2>parseInt</LITERAL2>
<LITERAL2>parseFloat</LITERAL2>
<LITERAL2>escape</LITERAL2>
<LITERAL2>unescape</LITERAL2>
<LITERAL2>isNaN</LITERAL2>
<LITERAL2>isFinite</LITERAL2>
</KEYWORDS>
</RULES>
<!-- Delegate contents of #{} expression in double quotes to MAIN so that
it will be syntax highlighted as well -->
<RULES DEFAULT="LITERAL1" SET="doubleQuoteLiteral" ESCAPE="\">
<SPAN DELEGATE="MAIN" TYPE="OPERATOR">
<BEGIN>#{</BEGIN>
<END>}</END>
</SPAN>
</RULES>
<!-- Comments in heregexes -->
<RULES DEFAULT="MARKUP" SET="hereRegexp" ESCAPE="\">
<EOL_SPAN TYPE="COMMENT1">#</EOL_SPAN>
</RULES>
</MODE>