Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Completely rewriting syntax file, using JSON format, adding indent ru…

…les, comment syntax. Updating readme, license, etc, to reflect the code that now exists.
  • Loading branch information...
commit 1680b1ae4ef36f5364c63815342aeb6ccc4158e3 1 parent 76c0c09
Daniel Patterson authored August 11, 2012
3  LICENSE.txt
... ...
@@ -1,6 +1,3 @@
1  
-Copyright (c) 2012 Webmuse | Tom Ellis
2  
-Modified by Daniel Patterson
3  
-
4 1
 Permission is hereby granted, free of charge, to any person obtaining a copy
5 2
 of this software and associated documentation files (the "Software"), to deal
6 3
 in the Software without restriction, including without limitation the rights
29  README.md
Source Rendered
... ...
@@ -1,15 +1,36 @@
1 1
 # Sublime Text package for Rust
2 2
 
  3
+## About
  4
+
  5
+This package supports current rust at the time of writing;
  6
+it makes no attempt at backwards compatibility.
  7
+This is intended to be a feature - if keywords no longer highlight,
  8
+it means that the keyword has changed or will soon
  9
+
3 10
 ## Installation
4 11
 
5  
-Install the Package Control package if you haven't got it yet. Package Control is the best way to install packages for Sublime Text. See http://wbond.net/sublime_packages/package_control/installation for instructions.
  12
+Install the Package Control package if you haven't got it yet. Package 
  13
+Control is the best way to install packages for Sublime Text. See 
  14
+http://wbond.net/sublime_packages/package_control/installation for 
  15
+instructions.
6 16
 
7  
-Open the palette (`control+shift+P`) in Sublime Text and select `Package Control: Install Package` and then select `Rust` from the list. That's it.
  17
+Open the palette (`control+shift+P` or `command+shift+P`) in Sublime Text
  18
+and select `Package Control: Install Package` and then select `Rust` from 
  19
+the list. That's it.
8 20
 
9 21
 ## Credits
10 22
 
11  
-The language syntax file is taken with permission from the [Textmate bundle](https://github.com/tomgrohl/Rust.tmbundle) written by [Tom Ellis](https://github.com/tomgrohl).
  23
+Created 2012 by Daniel Patterson <dbp@riseup.net>.
  24
+
  25
+Last Updated: 2012.7.11
  26
+
  27
+Derived primarily from the Vim syntax file, maintained by
  28
+Patrick Walton <pcwalton@mozilla.com>
  29
+Ben Blum <bblum@mozilla.com>
  30
+
  31
+With a little help from the (now very outdated) TextMate rust mode written 
  32
+by [Tom Ellis](https://github.com/tomgrohl).
12 33
 
13 34
 ## License
14 35
 
15  
-This package is licensed under the MIT License ([LICENSE.txt](https://github.com/fmartini/sublime-rust/blob/master/LICENSE.txt)).
  36
+This package is licensed under the MIT License.
71  Rust.JSON-tmLanguage
... ...
@@ -0,0 +1,71 @@
  1
+{ "name": "Rust",
  2
+  "scopeName": "source.rust",
  3
+  "fileTypes": ["rs", "rc"],
  4
+  "foldingStartMarker": "^.*\\bfn\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$",
  5
+  "foldingStopMarker": "^\\s*\\}",
  6
+  "patterns": [
  7
+    {"name": "string.quoted.single.source.rust",
  8
+     "begin": "'",
  9
+     "end": "'",
  10
+     "patterns": [
  11
+      {"include": "#rust_escaped_character"}
  12
+      ]
  13
+    },
  14
+    {"name": "string.quoted.double.source.rust",
  15
+     "begin": "\"",
  16
+     "end": "\"",
  17
+     "patterns": [
  18
+      {"include": "#rust_escaped_character"}
  19
+     ]
  20
+    },
  21
+    {"name": "keyword.source.rust",
  22
+     "match": "\\b(again|as|break|check|claim|const|copy|do|drop|else|export|extern|fail|for|if|impl|import|in|let|log|loop|match|mod|module|move|mut|new|of|owned|priv|pub|pure|return|to|unchecked|use|while|with|mod|trait|class|struct|enum|type|fn)\\b"
  23
+    },
  24
+    {"name": "storage.type.source.rust",
  25
+     "match": "\\b(m32|m64|m128|f80|f16|f128|int|uint|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|option|either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b"
  26
+    },
  27
+    {"name": "variable.language.source.rust",
  28
+     "match": "\\bself\\b"
  29
+    },
  30
+    {"name": "constant.language.source.rust",
  31
+     "match": "\\b(true|false|some|none|left|right|ok|err|success|failure|cons|nil|empty|node)\\b"
  32
+    },
  33
+    {"name": "support.constant.source.rust",
  34
+     "match": "\\b(EXIT_FAILURE|EXIT_SUCCESS|RAND_MAX|EOF|SEEK_SET|SEEK_CUR|SEEK_END|_IOFBF|_IONBF|_IOLBF|BUFSIZ|FOPEN_MAX|FILENAME_MAX|L_tmpnam|TMP_MAX|O_RDONLY|O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_EXCL|O_TRUNC|S_IFIFO|S_IFCHR|S_IFBLK|S_IFDIR|S_IFREG|S_IFMT|S_IEXEC|S_IWRITE|S_IREAD|S_IRWXU|S_IXUSR|S_IWUSR|S_IRUSR|F_OK|R_OK|W_OK|X_OK|STDIN_FILENO|STDOUT_FILENO|STDERR_FILENO)\\b"
  35
+    },
  36
+    {"name": "meta.preprocessor.source.rust",
  37
+     "match": "\\b(\\w\\(\\w\\)*!)|(#\\[[\\w=\\(\\)_]+\\])\\b"
  38
+    },
  39
+    {"name": "constant.numeric.integer.source.rust",
  40
+     "match": "\\b(([0-9][0-9_]*)|([0-9][0-9_]*(u|u8|u16|u32|u64))|([0-9][0-9_]*(i8|i16|i32|i64)))\\b"
  41
+    },
  42
+    {"name": "constant.numeric.hex.source.rust",
  43
+     "match": "\\b((0x[a-fA-F0-9_]+)|(0x[a-fA-F0-9_]+(u|u8|u16|u32|u64))|(0x[a-fA-F0-9_]+(i8|i16|i32|i64)))\\b"
  44
+    },
  45
+    {"name": "constant.numeric.binary.source.rust",
  46
+     "match": "\\b((0b[01_]+)|(0b[01_]+(u|u8|u16|u32|u64))|(0b[01_]+(i8|i16|i32|i64)))\\b"
  47
+    },
  48
+    {"name": "constant.numeric.float.source.rust",
  49
+     "match": "([0-9][0-9_]*(f|f32|f64))|([0-9][0-9_]*([eE][+-]=[0-9_]+))|([0-9][0-9_]*([eE][+-]=[0-9_]+)(f|f32|f64))|([0-9][0-9_]*\\.[0-9_]+)|([0-9][0-9_]*\\.[0-9_]+(f|f32|f64))|([0-9][0-9_]*\\.[0-9_]+%([eE][\\+-]=[0-9_]+))|([0-9][0-9_]*\\.[0-9_]+%([eE][+-]=[0-9_]+)(f|f32|f64))"
  50
+    },
  51
+    {"name": "comment.line.documentation.source.rust",
  52
+     "begin": "//!",
  53
+     "end": "$\\n"
  54
+    },
  55
+    {"name": "comment.line.double-dash.source.rust",
  56
+     "begin": "//",
  57
+     "end": "$\\n"
  58
+    },
  59
+    {"name": "comment.block.source.rust",
  60
+     "begin": "/\\*",
  61
+     "end": "\\*/"
  62
+    }
  63
+  ],
  64
+  "repository": {
  65
+    "rust_escaped_character": {
  66
+      "name": "constant.character.escape.source.rust",
  67
+      "match": "\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)"
  68
+    }
  69
+  },
  70
+  "uuid": "4339386b-4d67-4f0e-9e78-09ecbcddf71d"
  71
+}
2  Rust.sublime-build
... ...
@@ -1,5 +1,5 @@
1 1
 {
2 2
     "cmd": ["rustc", "$file"],
3  
-    "selector": "source.rs",
  3
+    "selector": "source.rust",
4 4
     "file_regex": "^(.*?):([0-9]+):([0-9]+):\\s[0-9]+:[0-9]+\\s(.*)$"
5 5
 }
381  Rust.tmLanguage
... ...
@@ -1,13 +1,25 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2  
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  2
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 3
 <plist version="1.0">
4 4
 <dict>
5  
-	<key>comment</key>
6  
-	<string>Rust Syntax: version 0.1</string>
  5
+	<key>_comment</key>
  6
+	<array>
  7
+		<string>Created 2012 by Daniel Patterson &lt;dbp@riseup.net&gt;.</string>
  8
+		<string>Mit License.</string>
  9
+		<string>Last Updated: 2012.7.11.</string>
  10
+		<string>Derived from the Vim syntax file, maintained by</string>
  11
+		<string>Patrick Walton &lt;pcwalton@mozilla.com&gt;</string>
  12
+		<string>Ben Blum &lt;bblum@mozilla.com&gt;.</string>
  13
+		<string>With a little help from the TextMate rust mode by Webmuse | Tom Ellis.</string>
  14
+		<string>This syntax file supports current rust at the time of writing;</string>
  15
+		<string>it makes no attempt at backwards compatibility.</string>
  16
+		<string>This is intended to be a feature - if keywords no longer highlight,</string>
  17
+		<string>it means that the keyword has changed or will soon.</string>
  18
+	</array>
7 19
 	<key>fileTypes</key>
8 20
 	<array>
9 21
 		<string>rs</string>
10  
-		<string>jc</string>
  22
+		<string>rc</string>
11 23
 	</array>
12 24
 	<key>foldingStartMarker</key>
13 25
 	<string>^.*\bfn\s*(\w+\s*)?\([^\)]*\)(\s*\{[^\}]*)?\s*$</string>
@@ -18,400 +30,133 @@
18 30
 	<key>patterns</key>
19 31
 	<array>
20 32
 		<dict>
21  
-			<key>captures</key>
22  
-			<dict>
23  
-				<key>1</key>
24  
-				<dict>
25  
-					<key>name</key>
26  
-					<string>storage.type.fn.rust</string>
27  
-				</dict>
28  
-				<key>2</key>
29  
-				<dict>
30  
-					<key>name</key>
31  
-					<string>entity.name.fn.rust</string>
32  
-				</dict>
33  
-				<key>3</key>
34  
-				<dict>
35  
-					<key>name</key>
36  
-					<string>punctuation.definition.parameters.begin.rust</string>
37  
-				</dict>
38  
-				<key>4</key>
39  
-				<dict>
40  
-					<key>name</key>
41  
-					<string>variable.parameter.fn.rust</string>
42  
-				</dict>
43  
-				<key>5</key>
44  
-				<dict>
45  
-					<key>name</key>
46  
-					<string>punctuation.definition.parameters.end.rust</string>
47  
-				</dict>
48  
-			</dict>
49  
-			<key>comment</key>
50  
-			<string>match regular fn like: fn myFunc(arg : type,...) { … }</string>
51  
-			<key>match</key>
52  
-			<string>\b(fn)\s+([a-zA-Z_$]\w*)?\s*(\()(([-+a-zA-Z_]+)\s?\:\s?([@~&amp;&le;&ge;\[\]A-Za-z_]+)(,)?(\n)?)*(\))</string>
53  
-			<key>name</key>
54  
-			<string>meta.fnargs.rust</string>
55  
-		</dict>
56  
-		<dict>
57  
-			<key>captures</key>
58  
-			<dict>
59  
-				<key>1</key>
60  
-				<dict>
61  
-					<key>name</key>
62  
-					<string>storage.type.fn.rust</string>
63  
-				</dict>
64  
-				<key>2</key>
65  
-				<dict>
66  
-					<key>name</key>
67  
-					<string>entity.name.fn.rust</string>
68  
-				</dict>
69  
-				<key>3</key>
70  
-				<dict>
71  
-					<key>name</key>
72  
-					<string>punctuation.definition.parameters.begin.rust</string>
73  
-				</dict>
74  
-				<key>4</key>
75  
-				<dict>
76  
-					<key>name</key>
77  
-					<string>variable.parameter.fn.rust</string>
78  
-				</dict>
79  
-				<key>5</key>
80  
-				<dict>
81  
-					<key>name</key>
82  
-					<string>punctuation.definition.parameters.end.rust</string>
83  
-				</dict>
84  
-			</dict>
85  
-			<key>comment</key>
86  
-			<string>match regular fn like: fn myFunc(arg) { … }</string>
87  
-			<key>match</key>
88  
-			<string>\b(fn)\s+([a-zA-Z_$]\w*)?\s*(\()(?!\:.*?)(\))</string>
89  
-			<key>name</key>
90  
-			<string>meta.fn.rust</string>
91  
-		</dict>
92  
-		<dict>
93  
-			<key>captures</key>
94  
-			<dict>
95  
-				<key>1</key>
96  
-				<dict>
97  
-					<key>name</key>
98  
-					<string>storage.type.fn.rust</string>
99  
-				</dict>
100  
-				<key>2</key>
101  
-				<dict>
102  
-					<key>name</key>
103  
-					<string>entity.name.fn.rust</string>
104  
-				</dict>
105  
-				<key>3</key>
106  
-				<dict>
107  
-					<key>name</key>
108  
-					<string>punctuation.definition.parameters.begin.rust</string>
109  
-				</dict>
110  
-				<key>4</key>
111  
-				<dict>
112  
-					<key>name</key>
113  
-					<string>variable.parameter.fn.rust</string>
114  
-				</dict>
115  
-				<key>5</key>
116  
-				<dict>
117  
-					<key>name</key>
118  
-					<string>punctuation.definition.parameters.end.rust</string>
119  
-				</dict>
120  
-			</dict>
121  
-			<key>comment</key>
122  
-			<string>match regular fn like: fn myFunc(arg) { … }</string>
123  
-			<key>match</key>
124  
-			<string>\b(mod|enum)\s+([a-zA-Z_$]\w*)?\s?\{</string>
125  
-			<key>name</key>
126  
-			<string>meta.extras.rust</string>
127  
-		</dict>
128  
-		<dict>
129  
-			<key>match</key>
130  
-			<string>\b((0(x|X)[0-9a-fA-F]+)|([0-9]+(\.[0-9]+)?))\b</string>
131  
-			<key>name</key>
132  
-			<string>constant.numeric.rust</string>
133  
-		</dict>
134  
-		<dict>
135  
-			<key>match</key>
136  
-			<string>\s?(\#([a-zA-Z]+))</string>
137  
-			<key>name</key>
138  
-			<string>constant.special.rust</string>
139  
-		</dict>
140  
-		<dict>
141 33
 			<key>begin</key>
142 34
 			<string>'</string>
143  
-			<key>beginCaptures</key>
144  
-			<dict>
145  
-				<key>0</key>
146  
-				<dict>
147  
-					<key>name</key>
148  
-					<string>punctuation.definition.string.begin.rust</string>
149  
-				</dict>
150  
-			</dict>
151 35
 			<key>end</key>
152 36
 			<string>'</string>
153  
-			<key>endCaptures</key>
154  
-			<dict>
155  
-				<key>0</key>
156  
-				<dict>
157  
-					<key>name</key>
158  
-					<string>punctuation.definition.string.end.rust</string>
159  
-				</dict>
160  
-			</dict>
161 37
 			<key>name</key>
162  
-			<string>string.quoted.single.rust</string>
  38
+			<string>string.quoted.single.source.rust</string>
163 39
 			<key>patterns</key>
164 40
 			<array>
165 41
 				<dict>
166  
-					<key>match</key>
167  
-					<string>\\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)</string>
168  
-					<key>name</key>
169  
-					<string>constant.character.escape.rust</string>
  42
+					<key>include</key>
  43
+					<string>#rust_escaped_character</string>
170 44
 				</dict>
171 45
 			</array>
172 46
 		</dict>
173 47
 		<dict>
174 48
 			<key>begin</key>
175 49
 			<string>"</string>
176  
-			<key>beginCaptures</key>
177  
-			<dict>
178  
-				<key>0</key>
179  
-				<dict>
180  
-					<key>name</key>
181  
-					<string>punctuation.definition.string.begin.rust</string>
182  
-				</dict>
183  
-			</dict>
184 50
 			<key>end</key>
185 51
 			<string>"</string>
186  
-			<key>endCaptures</key>
187  
-			<dict>
188  
-				<key>0</key>
189  
-				<dict>
190  
-					<key>name</key>
191  
-					<string>punctuation.definition.string.end.rust</string>
192  
-				</dict>
193  
-			</dict>
194 52
 			<key>name</key>
195  
-			<string>string.quoted.double.rust</string>
  53
+			<string>string.quoted.double.source.rust</string>
196 54
 			<key>patterns</key>
197 55
 			<array>
198 56
 				<dict>
199  
-					<key>match</key>
200  
-					<string>\\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)</string>
201  
-					<key>name</key>
202  
-					<string>constant.character.escape.rust</string>
  57
+					<key>include</key>
  58
+					<string>#rust_escaped_character</string>
203 59
 				</dict>
204 60
 			</array>
205 61
 		</dict>
206 62
 		<dict>
207  
-			<key>begin</key>
208  
-			<string>/\*\*(?!/)</string>
209  
-			<key>captures</key>
210  
-			<dict>
211  
-				<key>0</key>
212  
-				<dict>
213  
-					<key>name</key>
214  
-					<string>punctuation.definition.comment.rust</string>
215  
-				</dict>
216  
-			</dict>
217  
-			<key>end</key>
218  
-			<string>\*/</string>
219  
-			<key>name</key>
220  
-			<string>comment.block.documentation.rust</string>
221  
-		</dict>
222  
-		<dict>
223  
-			<key>begin</key>
224  
-			<string>/\*</string>
225  
-			<key>captures</key>
226  
-			<dict>
227  
-				<key>0</key>
228  
-				<dict>
229  
-					<key>name</key>
230  
-					<string>punctuation.definition.comment.rust</string>
231  
-				</dict>
232  
-			</dict>
233  
-			<key>end</key>
234  
-			<string>\*/</string>
235  
-			<key>name</key>
236  
-			<string>comment.block.rust</string>
237  
-		</dict>
238  
-		<dict>
239  
-			<key>captures</key>
240  
-			<dict>
241  
-				<key>1</key>
242  
-				<dict>
243  
-					<key>name</key>
244  
-					<string>punctuation.definition.comment.rust</string>
245  
-				</dict>
246  
-			</dict>
247  
-			<key>match</key>
248  
-			<string>(//).*$\n?</string>
249  
-			<key>name</key>
250  
-			<string>comment.line.double-slash.rust</string>
251  
-		</dict>
252  
-		<dict>
253  
-			<key>match</key>
254  
-			<string>\b(bool|byte|char|class|double|enum|float|f([0-9]+)|fn|int|use|uint|u([0-9]+)|i([0-9]+)|trait|impl|mod|long|mut|type|short|struct|str|mod|native|let)\b</string>
255  
-			<key>name</key>
256  
-			<string>storage.type.rust</string>
257  
-		</dict>
258  
-		<dict>
259 63
 			<key>match</key>
260  
-			<string>\b(some|none|left|right|ok|err|success|failure|cons|nil)\b</string>
  64
+			<string>\b(again|as|break|check|claim|const|copy|do|drop|else|export|extern|fail|for|if|impl|import|in|let|log|loop|match|mod|module|move|mut|new|of|owned|priv|pub|pure|return|to|unchecked|use|while|with|mod|trait|class|struct|enum|type|fn)\b</string>
261 65
 			<key>name</key>
262  
-			<string>constant.rust</string>
  66
+			<string>keyword.source.rust</string>
263 67
 		</dict>
264 68
 		<dict>
265 69
 			<key>match</key>
266  
-			<string>\b(const|export|extern|pure|copy|move|extends|final|implements|native|private|protected|public|@|~)\b</string>
  70
+			<string>\b(m32|m64|m128|f80|f16|f128|int|uint|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|option|either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\b</string>
267 71
 			<key>name</key>
268  
-			<string>storage.modifier.rust</string>
  72
+			<string>storage.type.source.rust</string>
269 73
 		</dict>
270 74
 		<dict>
271 75
 			<key>match</key>
272  
-			<string>\b(\||break|match|again|fail|in|do|else|for|to|if|import|package|return|while)\b</string>
  76
+			<string>\bself\b</string>
273 77
 			<key>name</key>
274  
-			<string>keyword.control.rust</string>
  78
+			<string>variable.language.source.rust</string>
275 79
 		</dict>
276 80
 		<dict>
277 81
 			<key>match</key>
278  
-			<string>\b(drop|in|new|with|as|use)\b</string>
  82
+			<string>\b(true|false|some|none|left|right|ok|err|success|failure|cons|nil|empty|node)\b</string>
279 83
 			<key>name</key>
280  
-			<string>keyword.operator.rust</string>
  84
+			<string>constant.language.source.rust</string>
281 85
 		</dict>
282 86
 		<dict>
283 87
 			<key>match</key>
284  
-			<string>\btrue\b</string>
  88
+			<string>\b(EXIT_FAILURE|EXIT_SUCCESS|RAND_MAX|EOF|SEEK_SET|SEEK_CUR|SEEK_END|_IOFBF|_IONBF|_IOLBF|BUFSIZ|FOPEN_MAX|FILENAME_MAX|L_tmpnam|TMP_MAX|O_RDONLY|O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_EXCL|O_TRUNC|S_IFIFO|S_IFCHR|S_IFBLK|S_IFDIR|S_IFREG|S_IFMT|S_IEXEC|S_IWRITE|S_IREAD|S_IRWXU|S_IXUSR|S_IWUSR|S_IRUSR|F_OK|R_OK|W_OK|X_OK|STDIN_FILENO|STDOUT_FILENO|STDERR_FILENO)\b</string>
285 89
 			<key>name</key>
286  
-			<string>constant.language.boolean.true.rust</string>
  90
+			<string>support.constant.source.rust</string>
287 91
 		</dict>
288 92
 		<dict>
289 93
 			<key>match</key>
290  
-			<string>\bfalse\b</string>
  94
+			<string>\b(\w\(\w\)*!)|(#\[[\w=\(\)_]+\])\b</string>
291 95
 			<key>name</key>
292  
-			<string>constant.language.boolean.false.rust</string>
  96
+			<string>meta.preprocessor.source.rust</string>
293 97
 		</dict>
294 98
 		<dict>
295 99
 			<key>match</key>
296  
-			<string>\bnull\b</string>
  100
+			<string>\b(([0-9][0-9_]*)|([0-9][0-9_]*(u|u8|u16|u32|u64))|([0-9][0-9_]*(i8|i16|i32|i64)))\b</string>
297 101
 			<key>name</key>
298  
-			<string>constant.language.null.rust</string>
  102
+			<string>constant.numeric.integer.source.rust</string>
299 103
 		</dict>
300 104
 		<dict>
301 105
 			<key>match</key>
302  
-			<string>\b(self)\b</string>
  106
+			<string>\b((0x[a-fA-F0-9_]+)|(0x[a-fA-F0-9_]+(u|u8|u16|u32|u64))|(0x[a-fA-F0-9_]+(i8|i16|i32|i64)))\b</string>
303 107
 			<key>name</key>
304  
-			<string>variable.language.rust</string>
  108
+			<string>constant.numeric.hex.source.rust</string>
305 109
 		</dict>
306 110
 		<dict>
307 111
 			<key>match</key>
308  
-			<string>\b(log|assert)\b</string>
  112
+			<string>\b((0b[01_]+)|(0b[01_]+(u|u8|u16|u32|u64))|(0b[01_]+(i8|i16|i32|i64)))\b</string>
309 113
 			<key>name</key>
310  
-			<string>keyword.other.rust</string>
  114
+			<string>constant.numeric.binary.source.rust</string>
311 115
 		</dict>
312 116
 		<dict>
313 117
 			<key>match</key>
314  
-			<string>\b(std|str|io|float|consts|crypto|vec|unsafe|ptr)\b</string>
  118
+			<string>([0-9][0-9_]*(f|f32|f64))|([0-9][0-9_]*([eE][+-]=[0-9_]+))|([0-9][0-9_]*([eE][+-]=[0-9_]+)(f|f32|f64))|([0-9][0-9_]*\.[0-9_]+)|([0-9][0-9_]*\.[0-9_]+(f|f32|f64))|([0-9][0-9_]*\.[0-9_]+%([eE][\+-]=[0-9_]+))|([0-9][0-9_]*\.[0-9_]+%([eE][+-]=[0-9_]+)(f|f32|f64))</string>
315 119
 			<key>name</key>
316  
-			<string>support.class.rust</string>
317  
-		</dict>
318  
-		<dict>
319  
-			<key>match</key>
320  
-			<string>!|\$|%|&amp;|\*|\-\-|\-|\+\+|\+|--&gt;|==|=|!=|!=|&lt;=|&gt;=|&lt;&lt;=|&gt;&gt;=|&gt;&gt;&gt;=|&lt;&gt;|&lt;|&gt;|!|&amp;&amp;|\|\||\?\:|\*=|(?&lt;!\()/=|%=|\+=|\-=|&amp;=|\^=|::|\b(in)\b</string>
321  
-			<key>name</key>
322  
-			<string>keyword.operator.rust</string>
  120
+			<string>constant.numeric.float.source.rust</string>
323 121
 		</dict>
324 122
 		<dict>
325 123
 			<key>begin</key>
326  
-			<string>(?&lt;=[=(:]|^|ret)\s*(/)(?![/*+{}?])</string>
327  
-			<key>beginCaptures</key>
328  
-			<dict>
329  
-				<key>1</key>
330  
-				<dict>
331  
-					<key>name</key>
332  
-					<string>punctuation.definition.string.begin.rust</string>
333  
-				</dict>
334  
-			</dict>
  124
+			<string>//!</string>
335 125
 			<key>end</key>
336  
-			<string>(/)[igm]*</string>
337  
-			<key>endCaptures</key>
338  
-			<dict>
339  
-				<key>1</key>
340  
-				<dict>
341  
-					<key>name</key>
342  
-					<string>punctuation.definition.string.end.rust</string>
343  
-				</dict>
344  
-			</dict>
  126
+			<string>$\n</string>
345 127
 			<key>name</key>
346  
-			<string>string.regexp.rust</string>
347  
-			<key>patterns</key>
348  
-			<array>
349  
-				<dict>
350  
-					<key>match</key>
351  
-					<string>\\.</string>
352  
-					<key>name</key>
353  
-					<string>constant.character.escape.rust</string>
354  
-				</dict>
355  
-			</array>
  128
+			<string>comment.line.documentation.source.rust</string>
356 129
 		</dict>
357 130
 		<dict>
358  
-			<key>match</key>
359  
-			<string>\;</string>
360  
-			<key>name</key>
361  
-			<string>punctuation.terminator.statement.rust</string>
362  
-		</dict>
363  
-		<dict>
364  
-			<key>match</key>
365  
-			<string>,[ |\t]*</string>
366  
-			<key>name</key>
367  
-			<string>meta.delimiter.object.comma.rust</string>
368  
-		</dict>
369  
-		<dict>
370  
-			<key>match</key>
371  
-			<string>\.</string>
372  
-			<key>name</key>
373  
-			<string>meta.delimiter.method.period.rust</string>
374  
-		</dict>
375  
-		<dict>
376  
-			<key>match</key>
377  
-			<string>\{|\}</string>
378  
-			<key>name</key>
379  
-			<string>meta.brace.curly.rust</string>
380  
-		</dict>
381  
-		<dict>
382  
-			<key>match</key>
383  
-			<string>\(|\)</string>
384  
-			<key>name</key>
385  
-			<string>meta.brace.round.rust</string>
386  
-		</dict>
387  
-		<dict>
388  
-			<key>match</key>
389  
-			<string>\[|\]</string>
390  
-			<key>name</key>
391  
-			<string>meta.brace.square.rust</string>
392  
-		</dict>
393  
-		<dict>
394  
-			<key>match</key>
395  
-			<string>(#)[a-zA-Z][a-zA-Z0-9_-]*</string>
  131
+			<key>begin</key>
  132
+			<string>//</string>
  133
+			<key>end</key>
  134
+			<string>$\n</string>
396 135
 			<key>name</key>
397  
-			<string>meta.fn.rust</string>
  136
+			<string>comment.line.double-dash.source.rust</string>
398 137
 		</dict>
399 138
 		<dict>
400  
-			<key>match</key>
401  
-			<string>(use)\s+(\w+)</string>
  139
+			<key>begin</key>
  140
+			<string>/\*</string>
  141
+			<key>end</key>
  142
+			<string>\*/</string>
402 143
 			<key>name</key>
403  
-			<string>meta.use.rust</string>
  144
+			<string>comment.block.source.rust</string>
404 145
 		</dict>
  146
+	</array>
  147
+	<key>repository</key>
  148
+	<dict>
  149
+		<key>rust_escaped_character</key>
405 150
 		<dict>
406 151
 			<key>match</key>
407  
-			<string>(import)\s+(\w+)((::)?(\w+)?)</string>
  152
+			<string>\\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)</string>
408 153
 			<key>name</key>
409  
-			<string>meta.import.rust</string>
  154
+			<string>constant.character.escape.source.rust</string>
410 155
 		</dict>
411  
-	</array>
  156
+	</dict>
412 157
 	<key>scopeName</key>
413 158
 	<string>source.rust</string>
414 159
 	<key>uuid</key>
415  
-	<string>E54FA931-0668-4496-8922-F91520AD02B3</string>
  160
+	<string>4339386b-4d67-4f0e-9e78-09ecbcddf71d</string>
416 161
 </dict>
417 162
 </plist>
8  RustIndent.JSON-tmPreferences
... ...
@@ -0,0 +1,8 @@
  1
+{
  2
+    "name": "Rust Indent",
  3
+    "scope": "source.rust",
  4
+    "settings": {
  5
+        "increaseIndentPattern": "^.*\\{[^}\"']*$",
  6
+        "decreaseIndentPattern": "^(.*\\*/)?\\s*\\}.*$"
  7
+    }
  8
+}
17  RustIndent.tmPreferences
... ...
@@ -0,0 +1,17 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3
+<plist version="1.0">
  4
+<dict>
  5
+	<key>name</key>
  6
+	<string>Rust Indent</string>
  7
+	<key>scope</key>
  8
+	<string>source.rust</string>
  9
+	<key>settings</key>
  10
+	<dict>
  11
+		<key>decreaseIndentPattern</key>
  12
+		<string>^(.*\*/)?\s*\}.*$</string>
  13
+		<key>increaseIndentPattern</key>
  14
+		<string>^.*\{[^}"']*$</string>
  15
+	</dict>
  16
+</dict>
  17
+</plist>

0 notes on commit 1680b1a

Please sign in to comment.
Something went wrong with that request. Please try again.