-
Notifications
You must be signed in to change notification settings - Fork 0
/
bs.xml
167 lines (165 loc) · 8.54 KB
/
bs.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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Highlighting for the BS language created by Mark Rendle, as defined in his talk at NDC Oslo 2021.
See <https://www.youtube.com/watch?v=vcFBwt1nu2U> for the full talk.
One difference with these specifications is that double quotes ('' '', "" "" and «« »»)
are replaced with triple quotes (''' ''', """ """ and ««« »»») for technical reasons.
-->
<language name="BS" section="Scripts" extensions="*.bs" version="1" kateversion="2.4">
<highlighting>
<list name="keywords">
<item>class</item>
<item>public</item>
<item>private</item>
<item>protected</item>
<item>function</item>
<item>__construct</item>
<item>unless</item>
<item>else</item>
<item>echo</item>
<item>isProbablyA</item>
<item>isProbablyAn</item>
<item>areProbably</item>
<item>Delete</item>
<item>Dim</item>
<item>As</item>
<item>Let</item>
<item>goto</item>
<item>do</item>
<item>and</item>
<item>new</item>
<item>extends</item>
<item>HALT_AND_CATCH_FIRE</item>
</list>
<list name="builtins">
<item>BS</item>
<item>String</item>
<item>Strings</item>
<item>Integer</item>
<item>Integers</item>
<item>Float</item>
<item>Floats</item>
<item>DateTime</item>
<item>DateTimes</item>
<item>len</item>
</list>
<list name="literals">
<item>null</item>
<item>undefined</item>
<item>true</item>
<item>false</item>
<item>🥧</item>
</list>
<contexts>
<context lineEndContext="#pop" name="root">
<RegExpr attribute="Operator" context="#stay" String="[+*/%,<>;;():!=|&^~-]"/>
<RegExpr attribute="Macro" context="macro" String="#define " firstNonSpace="true"/>
<keyword attribute="Keyword" context="#stay" String="keywords"/>
<!-- Literals -->
<keyword attribute="Literal" context="#stay" String="literals"/>
<RegExpr attribute="Float" context="#stay" String="\b(\d(_?\d)*\.(\d(_?\d)*)?|\.?\d(_?\d)*)([eE]-?\d(_?\d)*)?"/>
<RegExpr attribute="Integer" context="#stay" String="\b\d(_?\d)*"/>
<!-- Strings -->
<StringDetect attribute="ANSI String" context="ansi_string" String="'''"/>
<DetectChar attribute="ASCII String" context="ascii_string" char="'"/>
<StringDetect attribute="EBCDIC String" context="ebcdic_string" String="""""/>
<DetectChar attribute="DBCS String" context="dbcs_string" char="""/>
<StringDetect attribute="Interpolated UTF-256 String" context="interp_utf256_string" String="«««"/>
<DetectChar attribute="UTF-256 String" context="utf256_string" char="«"/>
<!-- Identifiers -->
<keyword attribute="Builtins" context="#stay" String="builtins"/>
<RegExpr attribute="Variable" context="#stay" String="€[a-zA-Z_]\w*"/>
<DetectIdentifier attribute="Identifier"/>
<!-- Comments -->
<RegExpr attribute="Comment" context="multiline_comment" String="^\t $"/>
<RegExpr attribute="Comment" context="comment" String="^ ( )*(?=\b)"/><!-- Odd number of spaces -->
<RegExpr attribute="Error" context="#stay" String="[^ \n\r\t]"/>
</context>
<context attribute="Macro" lineEndContext="#pop" name="macro">
<DetectChar attribute="Regex" context="regex" char="/"/>
</context>
<context attribute="Regex" lineEndContext="#pop" name="regex">
</context>
<context attribute="Comment" lineEndContext="#pop" name="comment">
<keyword attribute="Comment Task" context="#stay" String="comment_tasks"/>
</context>
<context attribute="Comment" lineEndContext="#stay" name="multiline_comment">
<keyword attribute="Comment Task" context="#stay" String="comment_tasks"/>
<RegExpr attribute="Comment" context="#pop" String="^ \t$"/>
</context>
<context attribute="ASCII String" lineEndContext="#pop" name="ascii_string">
<RegExpr attribute="Escape" String="\\['\\]" context="#stay"/>
<RegExpr attribute="Error" String="\\[^'\\]" context="#stay"/>
<DetectChar attribute="ASCII String" context="#pop" char="'"/>
</context>
<context attribute="ANSI String" lineEndContext="#pop" name="ansi_string">
<RegExpr attribute="Escape" String="\\['\\]" context="#stay"/>
<RegExpr attribute="Error" String="\\[^'\\]" context="#stay"/>
<StringDetect attribute="ANSI String" context="#pop" String="'''"/>
</context>
<context attribute="DBCS String" lineEndContext="#pop" name="dbcs_string">
<RegExpr attribute="Escape" String="\\["\\]" context="#stay"/>
<RegExpr attribute="Error" String="\\[^"\\]" context="#stay"/>
<DetectChar attribute="DBCS String" context="#pop" char="""/>
</context>
<context attribute="EBCDIC String" lineEndContext="#pop" name="ebcdic_string">
<RegExpr attribute="Escape" String="\\["\\]" context="#stay"/>
<RegExpr attribute="Error" String="\\[^"\\]" context="#stay"/>
<StringDetect attribute="EBCDIC String" context="#pop" String="""""/>
</context>
<context attribute="UTF-256 String" lineEndContext="#pop" name="utf256_string">
<RegExpr attribute="Escape" String="\\[\\]" context="#stay"/>
<RegExpr attribute="Error" String="\\[^\\]" context="#stay"/>
<DetectChar attribute="UTF-256 String" context="#pop" char="»"/>
</context>
<context attribute="Interpolated UTF-256 String" lineEndContext="#pop" name="interp_utf256_string">
<RegExpr attribute="Escape" String="\\[»\\]" context="#stay"/>
<RegExpr attribute="Error" String="\\[^»\\]" context="#stay"/>
<StringDetect attribute="Interpolated UTF-256 String" context="#pop" String="»»»"/>
<StringDetect attribute="Interpolated Value" context="interp_value" String="${"/>
</context>
<context attribute="Interpolated Value" lineEndContext="#pop" name="interp_value">
<RegExpr attribute="Operator" context="#stay" String="[+*/%,<>;;():!=-]"/>
<keyword attribute="Literal" context="#stay" String="literals"/>
<!-- Literals -->
<keyword attribute="Literal" context="#stay" String="literals"/>
<RegExpr attribute="Float" context="#stay" String="\b(\d(_?\d)*\.(\d(_?\d)*)?|\.?\d(_?\d)*)([eE]-?\d(_?\d)*)?"/>
<RegExpr attribute="Integer" context="#stay" String="\b\d(_?\d)*"/>
<!-- Strings -->
<StringDetect attribute="ANSI String" context="ansi_string" String="'''"/>
<DetectChar attribute="ASCII String" context="ascii_string" char="'"/>
<StringDetect attribute="EBCDIC String" context="ebcdic_string" String="""""/>
<DetectChar attribute="DBCS String" context="dbcs_string" char="""/>
<DetectChar attribute="UTF-256 String" context="utf256_string" char="«"/>
<!-- Identifiers -->
<keyword attribute="Builtins" context="#stay" String="builtins"/>
<RegExpr attribute="Variable" context="#stay" String="€[a-zA-Z_]\w*"/>
<DetectIdentifier attribute="Identifier"/>
<DetectChar attribute="Interpolated Value" context="#pop" char="}"/>
</context>
</contexts>
<itemDatas>
<itemData name="Keyword" defStyleNum="dsKeyword"/>
<itemData name="Operator" defStyleNum="dsOperator"/>
<itemData name="Identifier" defStyleNum="dsFunction"/>
<itemData name="Variable" defStyleNum="dsVariable"/>
<itemData name="Literal" defStyleNum="dsConstant"/>
<itemData name="Integer" defStyleNum="dsDecVal"/>
<itemData name="Float" defStyleNum="dsFloat"/>
<itemData name="ASCII String" defStyleNum="dsString"/>
<itemData name="ANSI String" defStyleNum="dsString"/>
<itemData name="DBCS String" defStyleNum="dsString"/>
<itemData name="EBCDIC String" defStyleNum="dsString"/>
<itemData name="UTF-256 String" defStyleNum="dsString"/>
<itemData name="Interpolated UTF-256 String" defStyleNum="dsString"/>
<itemData name="Interpolated Value" defStyleNum="dsSpecialString"/>
<itemData name="Escape" defStyleNum="dsSpecialChar"/>
<itemData name="Builtins" defStyleNum="dsBuiltIn"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Comment Task" defStyleNum="dsAlert"/>
<itemData name="Error" defStyleNum="dsError"/>
<itemData name="Macro" defStyleNum="dsPreprocessor"/>
<itemData name="Regex" defStyleNum="dsSpecialString"/>
</itemDatas>
</highlighting>
</language>