Skip to content

Commit 0f41612

Browse files
committed
Add Rhai (Embedded scripting language for Rust) syntax definitions
1 parent 6310848 commit 0f41612

File tree

3 files changed

+263
-0
lines changed

3 files changed

+263
-0
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<!-- Embedded scripting language for Rust -->
4+
<SyntaxDefinition name="Rhai" extensions=".rhai">
5+
6+
<Environment>
7+
<Default color="#D4D4D4" bgcolor="#1E1E1E"/>
8+
<Selection color="#FFFFFF" bgcolor="#264F78"/>
9+
<LineNumbers color="#858585" bgcolor="#1E1E1E"/>
10+
<CaretMarker color="#2F2F2F"/>
11+
<VRuler color="#404040"/>
12+
13+
<FoldLine color="#5F5F5F" bgcolor="#1E1E1E"/>
14+
<FoldMarker color="#D4D4D4" bgcolor="#1E1E1E"/>
15+
<SelectedFoldLine color="#FFFFFF" bgcolor="#1E1E1E"/>
16+
17+
<EOLMarkers color="#404040"/>
18+
<SpaceMarkers color="#505050"/>
19+
<TabMarkers color="#505050"/>
20+
<InvalidLines color="#505050"/>
21+
</Environment>
22+
23+
<Properties>
24+
<Property name="LineComment" value="//"/>
25+
<Property name="BlockCommentBegin" value="/*"/>
26+
<Property name="BlockCommentEnd" value="*/"/>
27+
</Properties>
28+
29+
<Digits name="Digits" color="#B5CEA8"/>
30+
31+
<RuleSets>
32+
<RuleSet ignorecase="false">
33+
34+
<Delimiters>&lt;&gt;&amp;~!%^*()-_+=|\#/{}[]:;"' , ?</Delimiters>
35+
36+
<Span name="LineComment" stopateol="true" color="#6A9955" bold="false" italic="false">
37+
<Begin>//</Begin>
38+
</Span>
39+
40+
<Span name="BlockComment" stopateol="false" color="#6A9955" bold="false" italic="false">
41+
<Begin>/*</Begin>
42+
<End>*/</End>
43+
</Span>
44+
45+
<Span name="String" stopateol="false" color="#CE9178" bold="false" italic="false" escapecharacter='"'>
46+
<Begin>"</Begin>
47+
<End>"</End>
48+
</Span>
49+
50+
<Span name="CharString" stopateol="false" color="#CE9178" bold="false" italic="false" escapecharacter="'">
51+
<Begin>'</Begin>
52+
<End>'</End>
53+
</Span>
54+
55+
<MarkFollowing color="#C586C0" bold="true">fn</MarkFollowing>
56+
57+
<KeyWords name="Punctuation" color="#A0A0A0" bold="false">
58+
<Key word="!"/>
59+
<Key word="$"/>
60+
<Key word="%"/>
61+
<Key word="^"/>
62+
<Key word="&amp;"/>
63+
<Key word="*"/>
64+
<Key word="-"/>
65+
<Key word="_"/>
66+
<Key word="+"/>
67+
<Key word="="/>
68+
<Key word="/"/>
69+
<Key word="|"/>
70+
<Key word="&lt;"/>
71+
<Key word="&gt;"/>
72+
</KeyWords>
73+
74+
<KeyWords name="Keywords1" color="#569CD6" bold="false">
75+
<Key word="as"/>
76+
<Key word="break"/>
77+
<Key word="catch"/>
78+
<Key word="const"/>
79+
<Key word="continue"/>
80+
<Key word="else"/>
81+
<Key word="export"/>
82+
<Key word="fn"/>
83+
<Key word="for"/>
84+
<Key word="if"/>
85+
<Key word="import"/>
86+
<Key word="in"/>
87+
<Key word="is"/>
88+
<Key word="let"/>
89+
<Key word="loop"/>
90+
<Key word="private"/>
91+
<Key word="return"/>
92+
<Key word="switch"/>
93+
<Key word="case"/>
94+
<Key word="default"/>
95+
<Key word="throw"/>
96+
<Key word="try"/>
97+
<Key word="while"/>
98+
<Key word="true"/>
99+
<Key word="false"/>
100+
<Key word="this"/>
101+
</KeyWords>
102+
103+
<KeyWords name="Keywords2" color="#4EC9B0" bold="false">
104+
<Key word="bool"/>
105+
<Key word="char"/>
106+
<Key word="int"/>
107+
<Key word="float"/>
108+
<Key word="decimal"/>
109+
<Key word="string"/>
110+
<Key word="array"/>
111+
<Key word="map"/>
112+
<Key word="object"/>
113+
<Key word="dynamic"/>
114+
</KeyWords>
115+
116+
<KeyWords name="Keywords3" color="#C586C0" bold="false">
117+
<Key word="print"/>
118+
<Key word="debug"/>
119+
<Key word="eval"/>
120+
<Key word="type_of"/>
121+
<Key word="len"/>
122+
<Key word="push"/>
123+
<Key word="pop"/>
124+
<Key word="shift"/>
125+
<Key word="unshift"/>
126+
<Key word="keys"/>
127+
<Key word="values"/>
128+
</KeyWords>
129+
</RuleSet>
130+
</RuleSets>
131+
</SyntaxDefinition>
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<!-- Embedded scripting language for Rust -->
4+
<SyntaxDefinition name="Rhai" extensions=".rhai">
5+
6+
<Environment>
7+
<Default color="Black" bgcolor="#FFFFFF"/>
8+
<Selection color="Black" bgcolor="#C3C3FF"/>
9+
<LineNumbers color="Gray" bgcolor="#FFFFFF"/>
10+
<CaretMarker color="#F0F0F1"/>
11+
<VRuler color="#E0E0E5"/>
12+
13+
<FoldLine color="#A0A0A0" bgcolor="#FFFFFF"/>
14+
<FoldMarker color="Black" bgcolor="#FFFFFF"/>
15+
<SelectedFoldLine color="Black" bgcolor="#FFFFFF"/>
16+
17+
<EOLMarkers color="#CACAD2"/>
18+
<SpaceMarkers color="#B6B6C0"/>
19+
<TabMarkers color="#B6B6C0"/>
20+
<InvalidLines color="#B6B6C0"/>
21+
</Environment>
22+
23+
<Properties>
24+
<Property name="LineComment" value="//"/>
25+
<Property name="BlockCommentBegin" value="/*"/>
26+
<Property name="BlockCommentEnd" value="*/"/>
27+
</Properties>
28+
29+
<Digits name="Digits" color="DarkViolet"/>
30+
31+
<RuleSets>
32+
<RuleSet ignorecase="false">
33+
34+
<Delimiters>&lt;&gt;&amp;~!%^*()-_+=|\#/{}[]:;"' , ?</Delimiters>
35+
36+
<Span name="LineComment" stopateol="true" color="Green" bold="false" italic="false">
37+
<Begin>//</Begin>
38+
</Span>
39+
40+
<Span name="BlockComment" stopateol="false" color="Green" bold="false" italic="false">
41+
<Begin>/*</Begin>
42+
<End>*/</End>
43+
</Span>
44+
45+
<Span name="String" stopateol="false" color="Maroon" bold="false" italic="false" escapecharacter='"'>
46+
<Begin>"</Begin>
47+
<End>"</End>
48+
</Span>
49+
50+
<Span name="CharString" stopateol="false" color="Maroon" bold="false" italic="false" escapecharacter="'">
51+
<Begin>'</Begin>
52+
<End>'</End>
53+
</Span>
54+
55+
<MarkFollowing color="Purple" bold="true">fn</MarkFollowing>
56+
57+
<KeyWords name="Punctuation" color="#666666" bold="false">
58+
<Key word="!"/>
59+
<Key word="$"/>
60+
<Key word="%"/>
61+
<Key word="^"/>
62+
<Key word="&amp;"/>
63+
<Key word="*"/>
64+
<Key word="-"/>
65+
<Key word="_"/>
66+
<Key word="+"/>
67+
<Key word="="/>
68+
<Key word="/"/>
69+
<Key word="|"/>
70+
<Key word="&lt;"/>
71+
<Key word="&gt;"/>
72+
</KeyWords>
73+
74+
<KeyWords name="Keywords1" color="Blue" bold="false">
75+
<Key word="as"/>
76+
<Key word="break"/>
77+
<Key word="catch"/>
78+
<Key word="const"/>
79+
<Key word="continue"/>
80+
<Key word="else"/>
81+
<Key word="export"/>
82+
<Key word="fn"/>
83+
<Key word="for"/>
84+
<Key word="if"/>
85+
<Key word="import"/>
86+
<Key word="in"/>
87+
<Key word="is"/>
88+
<Key word="let"/>
89+
<Key word="loop"/>
90+
<Key word="private"/>
91+
<Key word="return"/>
92+
<Key word="switch"/>
93+
<Key word="case"/>
94+
<Key word="default"/>
95+
<Key word="throw"/>
96+
<Key word="try"/>
97+
<Key word="while"/>
98+
<Key word="true"/>
99+
<Key word="false"/>
100+
<Key word="this"/>
101+
</KeyWords>
102+
103+
<KeyWords name="Keywords2" color="DarkViolet" bold="false">
104+
<Key word="bool"/>
105+
<Key word="char"/>
106+
<Key word="int"/>
107+
<Key word="float"/>
108+
<Key word="decimal"/>
109+
<Key word="string"/>
110+
<Key word="array"/>
111+
<Key word="map"/>
112+
<Key word="object"/>
113+
<Key word="dynamic"/>
114+
</KeyWords>
115+
116+
<KeyWords name="Keywords3" color="Teal" bold="false">
117+
<Key word="print"/>
118+
<Key word="debug"/>
119+
<Key word="eval"/>
120+
<Key word="type_of"/>
121+
<Key word="len"/>
122+
<Key word="push"/>
123+
<Key word="pop"/>
124+
<Key word="shift"/>
125+
<Key word="unshift"/>
126+
<Key word="keys"/>
127+
<Key word="values"/>
128+
</KeyWords>
129+
</RuleSet>
130+
</RuleSets>
131+
</SyntaxDefinition>

SUPPORTED_FORMATS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ Update not completed yet...
106106
- `.rexx` (Rexx script)
107107
- `.ruby` (Ruby source)
108108
- `.rust` (Rust source)
109+
- `.rhai` (Embedded scripting language for Rust)
109110
- `.scala` (Scala source)
110111
- `.scheme` (Scheme source)
111112
- `.shellscript`, `.sh` (Shell script)

0 commit comments

Comments
 (0)