class library: PriorityQueue - implement removeValue, hide array
[supercollider.git] / editors / sced / data / supercollider.lang
blobe05e6edd2d4f2c9bb8f43f10e6ec553736e71a86
1 <?xml version="1.0" encoding="UTF-8"?>
3 <language id="supercollider" _name="SuperCollider" version="2.0" _section="Sources">
4 <metadata>
5 <property name="mimetypes">text/x-sc</property>
6 <property name="globs">*.sc;*.scd</property>
7 <property name="line-comment-start">//</property>
8 <property name="block-comment-start">/*</property>
9 <property name="block-comment-end">*/</property>
10 </metadata>
12 <styles>
13 <style id="comment" _name="Comment" map-to="def:comment"/>
14 <style id="error" _name="Error" map-to="def:error"/>
15 <style id="keyword" _name="Keyword" map-to="def:keyword"/>
16 <style id="number" _name="Number" map-to="def:number"/>
18 <!-- characters -->
20 <style id="string" _name="String" map-to="def:string"/>
21 <style id="symbol" _name="Symbol" map-to="def:string"/>
23 <!-- identifiers -->
25 <style id="class-name" _name="Class Name" map-to="def:type"/>
26 <style id="special-value" _name="Special Value" map-to="def:special-constant"/>
27 <style id="pseudo-variable" _name="Pseudo Variable" map-to="def:identifier"/>
28 </styles>
30 <definitions>
31 <context id="line-comment" style-ref="comment" end-at-line-end="true">
32 <start>//</start>
33 <include>
34 <context ref="def:in-comment"/>
35 </include>
36 </context>
38 <context id="block-comment" style-ref="comment">
39 <start>/\*</start>
40 <end>\*/</end>
41 <include>
42 <context ref="def:in-comment"/>
43 <context ref="block-comment"/> <!-- nested comments are okay -->
44 </include>
45 </context>
47 <context id="close-comment-outside-comment" style-ref="error">
48 <match>\*/(?!\*)</match>
49 </context>
51 <!-- numbers -->
52 <context id="numbers" style-ref="number">
53 <!--
54 1. pi
55 2. default notation
56 3. base-n. "-" (in some cases) can be placed before and after 'r' (one or both means negative)
57 4. exponential notation supports only digits (not letters) after the "e" sign
58 -->
59 <match extended="true">
60 (?&lt;![\w\.])
62 \-?pi |
63 (\-?)([0-9]+)(\.[0-9]+)?(pi)? |
64 (\-?)([0-9]+[rR]{1,1})((\-?)[0-9A-Za-z\.]*)(pi)? |
65 (\-?)([0-9]+)(\.[0-9]+)?e(\-?)([0-9]+)(pi)?
67 (?!\w)
68 </match>
69 </context>
71 <!-- characters -->
72 <!-- XXX $\x evaluates as well as $x -->
73 <!-- $\t, $\n, etc. work as expected -->
74 <context id="characters" style-ref="string">
75 <match>\$(\\?).</match>
76 </context>
78 <!-- strings -->
79 <context id="strings" style-ref="string" end-at-line-end="false">
80 <start>"</start>
81 <end>"</end>
82 <include>
83 <context ref="def:escape"/>
84 </include>
85 </context>
87 <!-- symbols (quoted) -->
88 <context id="quoted-symbols" style-ref="symbol" end-at-line-end="true">
89 <start>'</start>
90 <end>'</end>
91 <include>
92 <context ref="def:escape"/>
93 </include>
94 </context>
96 <!-- symbols -->
97 <context id="symbols" style-ref="symbol">
98 <match>\\\w+</match>
99 </context>
101 <!-- identifiers -->
102 <!-- classes may not start with "_" -->
103 <context id="class-names" style-ref="class-name">
104 <keyword>[A-Z]\w*</keyword>
105 </context>
107 <context id="special-values" style-ref="special-value">
108 <keyword>true</keyword>
109 <keyword>false</keyword>
110 <keyword>nil</keyword>
111 <keyword>inf</keyword>
112 </context>
114 <context id="keywords" style-ref="keyword">
115 <keyword>var</keyword>
116 <keyword>arg</keyword>
117 <keyword>classvar</keyword>
118 <keyword>const</keyword>
119 </context>
121 <context id="control-operators" style-ref="keyword">
122 <keyword>if</keyword>
123 <keyword>while</keyword>
124 <keyword>forBy</keyword>
125 <keyword>for</keyword>
126 <keyword>do</keyword>
127 <keyword>switch</keyword>
128 <keyword>case</keyword>
129 <keyword>loop</keyword> <!-- not in Control-Structures.html -->
130 </context>
132 <context id="pseudo-variables" style-ref="pseudo-variable">
133 <keyword>super</keyword>
134 <keyword>thisFunctionDef</keyword>
135 <keyword>thisFunction</keyword>
136 <keyword>thisMethod</keyword>
137 <keyword>thisProcess</keyword>
138 <keyword>thisThread</keyword>
139 <keyword>this</keyword>
140 </context>
142 <context id="supercollider">
143 <include>
144 <context ref="line-comment"/>
145 <context ref="block-comment"/>
146 <context ref="close-comment-outside-comment"/>
148 <context ref="numbers"/>
149 <context ref="characters"/>
150 <context ref="strings"/>
151 <context ref="quoted-symbols"/>
152 <context ref="symbols"/>
154 <context ref="class-names"/>
155 <context ref="special-values"/>
157 <context ref="keywords"/>
158 <context ref="control-operators"/>
159 <context ref="pseudo-variables"/>
160 </include>
161 </context>
162 </definitions>
163 </language>