| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 |
<!-- |
|---|
| 3 |
A MiniD spec thrown together for gedit. Based on D and JavaScript specs |
|---|
| 4 |
--> |
|---|
| 5 |
<!-- |
|---|
| 6 |
MiniD Language specification |
|---|
| 7 |
|
|---|
| 8 |
Reference: |
|---|
| 9 |
http://www.dsource.org/projects/minid/wiki/LanguageSpec/Lexical |
|---|
| 10 |
--> |
|---|
| 11 |
<language id="minid" _name="MiniD" version="2.0" _section="Scripts"> |
|---|
| 12 |
<metadata> |
|---|
| 13 |
<property name="mimetypes">text/x-mdsrc</property> |
|---|
| 14 |
<property name="globs">*.md</property> |
|---|
| 15 |
<property name="line-comment-start">//</property> |
|---|
| 16 |
<property name="block-comment-start">/*</property> |
|---|
| 17 |
<property name="block-comment-end">*/</property> |
|---|
| 18 |
</metadata> |
|---|
| 19 |
|
|---|
| 20 |
<styles> |
|---|
| 21 |
<style id="comment" _name="Comment" map-to="def:comment"/> |
|---|
| 22 |
<style id="error" _name="Error" map-to="def:error"/> |
|---|
| 23 |
<style id="string" _name="String" map-to="def:string"/> |
|---|
| 24 |
<style id="keyword" _name="Keyword" map-to="def:keyword"/> |
|---|
| 25 |
<style id="type" _name="Data Type" map-to="def:type"/> |
|---|
| 26 |
<style id="special-token" _name="Special Token" map-to="def:preprocessor"/> |
|---|
| 27 |
<style id="null-value" _name="Null Value" map-to="def:special-constant"/> |
|---|
| 28 |
<style id="boolean" _name="Boolean" map-to="def:boolean"/> |
|---|
| 29 |
<style id="floating-point" _name="Floating point number" map-to="def:floating-point"/> |
|---|
| 30 |
<style id="decimal" _name="Decimal number" map-to="def:decimal"/> |
|---|
| 31 |
<style id="binary" _name="Binary number" map-to="def:base-n-integer"/> |
|---|
| 32 |
<style id="octal" _name="Octal number" map-to="def:base-n-integer"/> |
|---|
| 33 |
<style id="hexadecimal" _name="Hexadecimal number" map-to="def:base-n-integer"/> |
|---|
| 34 |
<style id="constructors" _name="Constructors" map-to="def:type"/> |
|---|
| 35 |
<style id="function" _name="Function" map-to="def:function"/> |
|---|
| 36 |
</styles> |
|---|
| 37 |
|
|---|
| 38 |
<definitions> |
|---|
| 39 |
|
|---|
| 40 |
<context id="line-comment" style-ref="comment" end-at-line-end="true"> |
|---|
| 41 |
<start>//</start> |
|---|
| 42 |
<include> |
|---|
| 43 |
<context ref="def:in-line-comment"/> |
|---|
| 44 |
</include> |
|---|
| 45 |
</context> |
|---|
| 46 |
|
|---|
| 47 |
<context id="block-comment" style-ref="comment"> |
|---|
| 48 |
<start>/\*</start> |
|---|
| 49 |
<end>\*/</end> |
|---|
| 50 |
<include> |
|---|
| 51 |
<context ref="def:in-comment"/> |
|---|
| 52 |
</include> |
|---|
| 53 |
</context> |
|---|
| 54 |
|
|---|
| 55 |
<context id="close-comment-outside-comment" style-ref="error"> |
|---|
| 56 |
<match>\*/(?!\*)</match> |
|---|
| 57 |
</context> |
|---|
| 58 |
|
|---|
| 59 |
<context id="nesting-comment" style-ref="comment"> |
|---|
| 60 |
<start>/\+</start> |
|---|
| 61 |
<end>\+/</end> |
|---|
| 62 |
<include> |
|---|
| 63 |
<context ref="nesting-comment"/> |
|---|
| 64 |
<context ref="def:in-comment"/> |
|---|
| 65 |
</include> |
|---|
| 66 |
</context> |
|---|
| 67 |
|
|---|
| 68 |
<context id="double-quoted-string" style-ref="string"> |
|---|
| 69 |
<start>"</start> |
|---|
| 70 |
<end>"</end> |
|---|
| 71 |
<include> |
|---|
| 72 |
<context ref="def:escape"/> |
|---|
| 73 |
<context ref="def:line-continue"/> |
|---|
| 74 |
</include> |
|---|
| 75 |
</context> |
|---|
| 76 |
|
|---|
| 77 |
<context id="single-quoted-string" style-ref="string" end-at-line-end="true"> |
|---|
| 78 |
<start>'</start> |
|---|
| 79 |
<end>'</end> |
|---|
| 80 |
<include> |
|---|
| 81 |
<context ref="def:escape"/> |
|---|
| 82 |
<context ref="def:line-continue"/> |
|---|
| 83 |
</include> |
|---|
| 84 |
</context> |
|---|
| 85 |
|
|---|
| 86 |
<context id="backtick-quoted-string" style-ref="string"> |
|---|
| 87 |
<start>`</start> |
|---|
| 88 |
<end>`</end> |
|---|
| 89 |
<include> |
|---|
| 90 |
<context ref="def:escape"/> |
|---|
| 91 |
<context ref="def:line-continue"/> |
|---|
| 92 |
</include> |
|---|
| 93 |
</context> |
|---|
| 94 |
|
|---|
| 95 |
<context id="keywords" style-ref="keyword"> |
|---|
| 96 |
<keyword>as</keyword> |
|---|
| 97 |
<keyword>break</keyword> |
|---|
| 98 |
<keyword>case</keyword> |
|---|
| 99 |
<keyword>class</keyword> |
|---|
| 100 |
<keyword>catch</keyword> |
|---|
| 101 |
<keyword>continue</keyword> |
|---|
| 102 |
<keyword>coroutine</keyword> |
|---|
| 103 |
<keyword>default</keyword> |
|---|
| 104 |
<keyword>do</keyword> |
|---|
| 105 |
<keyword>else</keyword> |
|---|
| 106 |
<keyword>false</keyword> |
|---|
| 107 |
<keyword>finally</keyword> |
|---|
| 108 |
<keyword>for</keyword> |
|---|
| 109 |
<keyword>foreach</keyword> |
|---|
| 110 |
<keyword>function</keyword> |
|---|
| 111 |
<keyword>global</keyword> |
|---|
| 112 |
<keyword>if</keyword> |
|---|
| 113 |
<keyword>import</keyword> |
|---|
| 114 |
<keyword>in</keyword> |
|---|
| 115 |
<keyword>is</keyword> |
|---|
| 116 |
<keyword>local</keyword> |
|---|
| 117 |
<keyword>module</keyword> |
|---|
| 118 |
<keyword>null</keyword> |
|---|
| 119 |
<keyword>return</keyword> |
|---|
| 120 |
<keyword>super</keyword> |
|---|
| 121 |
<keyword>switch</keyword> |
|---|
| 122 |
<keyword>this</keyword> |
|---|
| 123 |
<keyword>throw</keyword> |
|---|
| 124 |
<keyword>true</keyword> |
|---|
| 125 |
<keyword>try</keyword> |
|---|
| 126 |
<keyword>vararg</keyword> |
|---|
| 127 |
<keyword>while</keyword> |
|---|
| 128 |
<keyword>with</keyword> |
|---|
| 129 |
<keyword>yield</keyword> |
|---|
| 130 |
</context> |
|---|
| 131 |
|
|---|
| 132 |
<context id="null-value" style-ref="null-value"> |
|---|
| 133 |
<keyword>null</keyword> |
|---|
| 134 |
</context> |
|---|
| 135 |
|
|---|
| 136 |
<context id="boolean" style-ref="boolean"> |
|---|
| 137 |
<keyword>false</keyword> |
|---|
| 138 |
<keyword>true</keyword> |
|---|
| 139 |
</context> |
|---|
| 140 |
|
|---|
| 141 |
<context id="float" style-ref="floating-point"> |
|---|
| 142 |
<match extended="true"> |
|---|
| 143 |
(?<![\w\.]) |
|---|
| 144 |
([0-9_]+[Ee][-]?[0-9_]+|([0-9_]*\.[0-9_]+|[0-9_]+\.)([Ee][-]?[0-9_]+)?)[fFLi]? |
|---|
| 145 |
(?![\w\.]) |
|---|
| 146 |
</match> |
|---|
| 147 |
</context> |
|---|
| 148 |
|
|---|
| 149 |
<context id="decimal" style-ref="decimal"> |
|---|
| 150 |
<match extended="true"> |
|---|
| 151 |
(?<![\w\.]) |
|---|
| 152 |
([1-9][0-9_]*|0)([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)? |
|---|
| 153 |
(?![\w\.]) |
|---|
| 154 |
</match> |
|---|
| 155 |
</context> |
|---|
| 156 |
|
|---|
| 157 |
<context id="binary" style-ref="binary"> |
|---|
| 158 |
<match extended="true"> |
|---|
| 159 |
(?<![\w\.]) |
|---|
| 160 |
0[bB][01_]* |
|---|
| 161 |
(?![\w\.]) |
|---|
| 162 |
</match> |
|---|
| 163 |
</context> |
|---|
| 164 |
|
|---|
| 165 |
<context id="octal" style-ref="octal"> |
|---|
| 166 |
<match extended="true"> |
|---|
| 167 |
(?<![\w\.]) |
|---|
| 168 |
0[0-7_]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)? |
|---|
| 169 |
(?![\w\.]) |
|---|
| 170 |
</match> |
|---|
| 171 |
</context> |
|---|
| 172 |
|
|---|
| 173 |
<context id="hexadecimal" style-ref="hexadecimal"> |
|---|
| 174 |
<match extended="true"> |
|---|
| 175 |
(?<![\w\.]) |
|---|
| 176 |
0[xX][0-9a-fA-F_]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)? |
|---|
| 177 |
(?![\w\.]) |
|---|
| 178 |
</match> |
|---|
| 179 |
</context> |
|---|
| 180 |
|
|---|
| 181 |
<context id="constructors" style-ref="constructors"> |
|---|
| 182 |
<keyword>StringBuffer</keyword> |
|---|
| 183 |
</context> |
|---|
| 184 |
|
|---|
| 185 |
<context id="functions" style-ref="function"> |
|---|
| 186 |
<keyword>assert</keyword> |
|---|
| 187 |
<keyword>bindContext</keyword> |
|---|
| 188 |
<keyword>currentThread</keyword> |
|---|
| 189 |
<keyword>curry</keyword> |
|---|
| 190 |
<keyword>fieldsOf</keyword> |
|---|
| 191 |
<keyword>format</keyword> |
|---|
| 192 |
<keyword>eval</keyword> |
|---|
| 193 |
<keyword>getTraceback</keyword> |
|---|
| 194 |
<keyword>isArray</keyword> |
|---|
| 195 |
<keyword>isBool</keyword> |
|---|
| 196 |
<keyword>isChar</keyword> |
|---|
| 197 |
<keyword>isClass</keyword> |
|---|
| 198 |
<keyword>isFloat</keyword> |
|---|
| 199 |
<keyword>isFunction</keyword> |
|---|
| 200 |
<keyword>isInstance</keyword> |
|---|
| 201 |
<keyword>isInt</keyword> |
|---|
| 202 |
<keyword>isNamespace</keyword> |
|---|
| 203 |
<keyword>isNull</keyword> |
|---|
| 204 |
<keyword>isString</keyword> |
|---|
| 205 |
<keyword>isTable</keyword> |
|---|
| 206 |
<keyword>isThread</keyword> |
|---|
| 207 |
<keyword>loadJSON</keyword> |
|---|
| 208 |
<keyword>loadString</keyword> |
|---|
| 209 |
<keyword>methodsOf</keyword> |
|---|
| 210 |
<keyword>rawToString</keyword> |
|---|
| 211 |
<keyword>readf</keyword> |
|---|
| 212 |
<keyword>removeKey</keyword> |
|---|
| 213 |
<keyword>setModuleLoader</keyword> |
|---|
| 214 |
<keyword>toChar</keyword> |
|---|
| 215 |
<keyword>toFloat</keyword> |
|---|
| 216 |
<keyword>toInt</keyword> |
|---|
| 217 |
<keyword>toJSON</keyword> |
|---|
| 218 |
<keyword>toString</keyword> |
|---|
| 219 |
<keyword>typeof</keyword> |
|---|
| 220 |
<keyword>write</keyword> |
|---|
| 221 |
<keyword>writef</keyword> |
|---|
| 222 |
<keyword>writefln</keyword> |
|---|
| 223 |
<keyword>writeln</keyword> |
|---|
| 224 |
</context> |
|---|
| 225 |
|
|---|
| 226 |
<context id="minid"> |
|---|
| 227 |
<include> |
|---|
| 228 |
<context ref="def:shebang"/> |
|---|
| 229 |
<context ref="line-comment"/> |
|---|
| 230 |
<context ref="block-comment"/> |
|---|
| 231 |
<context ref="close-comment-outside-comment"/> |
|---|
| 232 |
<context ref="nesting-comment"/> |
|---|
| 233 |
<context ref="double-quoted-string"/> |
|---|
| 234 |
<context ref="single-quoted-string"/> |
|---|
| 235 |
<context ref="backtick-quoted-string"/> |
|---|
| 236 |
<context ref="keywords"/> |
|---|
| 237 |
<context ref="null-value"/> |
|---|
| 238 |
<context ref="boolean"/> |
|---|
| 239 |
<context ref="float"/> |
|---|
| 240 |
<context ref="binary"/> |
|---|
| 241 |
<context ref="octal"/> |
|---|
| 242 |
<context ref="decimal"/> |
|---|
| 243 |
<context ref="hexadecimal"/> |
|---|
| 244 |
<context ref="constructors"/> |
|---|
| 245 |
</include> |
|---|
| 246 |
</context> |
|---|
| 247 |
|
|---|
| 248 |
</definitions> |
|---|
| 249 |
|
|---|
| 250 |
</language> |
|---|