Skip to content

Commit 4bc1e84

Browse files
committed
---
yaml --- r: 46726 b: refs/heads/auto c: 0643df2 h: refs/heads/master v: v3
1 parent c0dbb9a commit 4bc1e84

File tree

11 files changed

+354
-91
lines changed

11 files changed

+354
-91
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: dd34178b4b4c0dbd4d5e5fda44fbdd608b733b3a
17+
refs/heads/auto: 0643df28a33f122af9cfbdf49970ab55ae08f106

branches/auto/src/etc/kate/rust.xml

Lines changed: 12 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE language SYSTEM "language.dtd"
3-
[
4-
<!-- TODO: Kate's regex engine has very limited support for
5-
predefined char classes, so making rustIdent consistent with actual
6-
Rust identifiers will be a bit difficult -->
7-
<!ENTITY rustIdent "[a-zA-Z_][a-zA-Z_0-9]*">
8-
<!ENTITY rustIntSuf "([iu](8|16|32|64)?)?">
9-
]>
10-
<language name="Rust" version="0.6" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
2+
<!DOCTYPE language SYSTEM "language.dtd">
3+
<language name="Rust" version="0.4.0" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
114
<highlighting>
125
<list name="fn">
136
<item> fn </item>
@@ -25,7 +18,9 @@
2518
<item> drop </item>
2619
<item> else </item>
2720
<item> enum </item>
21+
<item> export </item>
2822
<item> extern </item>
23+
<item> fail </item>
2924
<item> for </item>
3025
<item> if </item>
3126
<item> impl </item>
@@ -34,6 +29,7 @@
3429
<item> loop </item>
3530
<item> match </item>
3631
<item> mod </item>
32+
<item> move </item>
3733
<item> mut </item>
3834
<item> priv </item>
3935
<item> pub </item>
@@ -47,29 +43,6 @@
4743
<item> use </item>
4844
<item> while </item>
4945
</list>
50-
<list name="traits">
51-
<item> Const </item>
52-
<item> Copy </item>
53-
<item> Send </item>
54-
<item> Owned </item>
55-
<item> Eq </item>
56-
<item> Ord </item>
57-
<item> Num </item>
58-
<item> Ptr </item>
59-
<item> Drop </item>
60-
<item> Add </item>
61-
<item> Sub </item>
62-
<item> Mul </item>
63-
<item> Div </item>
64-
<item> Modulo </item>
65-
<item> Neg </item>
66-
<item> BitAnd </item>
67-
<item> BitOr </item>
68-
<item> BitXor </item>
69-
<item> Shl </item>
70-
<item> Shr </item>
71-
<item> Index </item>
72-
</list>
7346
<list name="types">
7447
<item> bool </item>
7548
<item> int </item>
@@ -90,7 +63,6 @@
9063
<item> Either </item>
9164
<item> Option </item>
9265
<item> Result </item>
93-
<item> Self </item>
9466
</list>
9567
<list name="ctypes">
9668
<item> c_float </item>
@@ -192,33 +164,23 @@
192164
<keyword String="type" attribute="Keyword" context="Type"/>
193165
<keyword String="keywords" attribute="Keyword" context="#stay"/>
194166
<keyword String="types" attribute="Type" context="#stay"/>
195-
<keyword String="traits" attribute="Trait" context="#stay"/>
196167
<keyword String="ctypes" attribute="CType" context="#stay"/>
197168
<keyword String="self" attribute="Self" context="#stay"/>
198169
<keyword String="constants" attribute="Constant" context="#stay"/>
199170
<keyword String="cconstants" attribute="CConstant" context="#stay"/>
200171
<Detect2Chars char="/" char1="/" attribute="Comment" context="Commentar 1"/>
201172
<Detect2Chars char="/" char1="*" attribute="Comment" context="Commentar 2" beginRegion="Comment"/>
202-
<RegExpr String="0x[0-9a-fA-F_]+&rustIntSuf;" attribute="Number" context="#stay"/>
203-
<RegExpr String="0b[0-1_]+&rustIntSuf;" attribute="Number" context="#stay"/>
173+
<RegExpr String="0x[0-9a-fA-F_]+(u8|u16|u32|u64|i8|i16|i32|i64|u|i)?" attribute="Number" context="#stay"/>
174+
<RegExpr String="0b[0-1_]+(u8|u16|u32|u64|i8|i16|i32|i64|u|i)?" attribute="Number" context="#stay"/>
204175
<RegExpr String="[0-9][0-9_]*\.[0-9_]*([eE][+-]?[0-9_]+)?(f32|f64|f)?" attribute="Number" context="#stay"/>
205-
<RegExpr String="[0-9][0-9_]*&rustIntSuf;" attribute="Number" context="#stay"/>
206-
<Detect2Chars char="#" char1="[" attribute="Attribute" context="Attribute" beginRegion="Attribute"/>
207-
<RegExpr String="&rustIdent;::" attribute="Scope"/>
208-
<RegExpr String="&rustIdent;!" attribute="Macro"/>
209-
<RegExpr String="&apos;&rustIdent;(?!&apos;)" attribute="Lifetime"/>
176+
<RegExpr String="[0-9][0-9_]*(u8|u16|u32|u64|i8|i16|i32|i64|u|i)?" attribute="Number" context="#stay"/>
177+
<RegExpr String="[a-zA-Z_][a-zA-Z0-9_]*::" attribute="Scope"/>
210178
<DetectChar char="{" attribute="Symbol" context="#stay" beginRegion="Brace" />
211179
<DetectChar char="}" attribute="Symbol" context="#stay" endRegion="Brace" />
212180
<DetectChar char="&quot;" attribute="String" context="String"/>
213181
<DetectChar char="&apos;" attribute="Character" context="Character"/>
214-
<DetectChar char="[" attribute="Symbol" context="#stay" beginRegion="Bracket" />
215-
<DetectChar char="]" attribute="Symbol" context="#stay" endRegion="Bracket" />
216182
<DetectIdentifier/>
217183
</context>
218-
<context attribute="Attribute" lineEndContext="#stay" name="Attribute">
219-
<DetectChar char="]" attribute="Attribute" context="#pop" endRegion="Attribute"/>
220-
<IncludeRules context="Normal"/>
221-
</context>
222184
<context attribute="Definition" lineEndContext="#stay" name="Function">
223185
<DetectSpaces/>
224186
<DetectChar char="(" attribute="Normal Text" context="#pop"/>
@@ -231,20 +193,13 @@
231193
</context>
232194
<context attribute="String" lineEndContext="#stay" name="String">
233195
<LineContinue attribute="String" context="#stay"/>
234-
<DetectChar char="\" attribute="CharEscape" context="CharEscape"/>
196+
<HlCStringChar attribute="String Char" context="#stay"/>
235197
<DetectChar attribute="String" context="#pop" char="&quot;"/>
236198
</context>
237199
<context attribute="Character" lineEndContext="#pop" name="Character">
238-
<DetectChar char="\" attribute="CharEscape" context="CharEscape"/>
200+
<HlCStringChar attribute="Character" context="#stay"/>
239201
<DetectChar attribute="Character" context="#pop" char="&apos;"/>
240202
</context>
241-
<context attribute="CharEscape" lineEndContext="#pop" name="CharEscape">
242-
<AnyChar String="nrt\&apos;&quot;" attribute="CharEscape" context="#pop"/>
243-
<RegExpr String="x[0-9a-fA-F]{2}" attribute="CharEscape" context="#pop"/>
244-
<RegExpr String="u[0-9a-fA-F]{4}" attribute="CharEscape" context="#pop"/>
245-
<RegExpr String="U[0-9a-fA-F]{8}" attribute="CharEscape" context="#pop"/>
246-
<RegExpr String="." attribute="Error" context="#pop"/>
247-
</context>
248203
<context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
249204
<context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
250205
<DetectSpaces/>
@@ -256,7 +211,6 @@
256211
<itemData name="Keyword" defStyleNum="dsKeyword" color="#770088" bold="1"/>
257212
<itemData name="Self" defStyleNum="dsKeyword" color="#FF0000" bold="1"/>
258213
<itemData name="Type" defStyleNum="dsKeyword" color="#4e9a06" bold="1"/>
259-
<itemData name="Trait" defStyleNum="dsKeyword" color="#4e9a06" bold="1"/>
260214
<itemData name="CType" defStyleNum="dsNormal" color="#4e9a06"/>
261215
<itemData name="Constant" defStyleNum="dsKeyword" color="#116644"/>
262216
<itemData name="CConstant" defStyleNum="dsNormal" color="#116644"/>
@@ -265,12 +219,8 @@
265219
<itemData name="Scope" defStyleNum="dsNormal" color="#0055AA"/>
266220
<itemData name="Number" defStyleNum="dsDecVal" color="#116644"/>
267221
<itemData name="String" defStyleNum="dsString" color="#FF0000"/>
268-
<itemData name="CharEscape" defStyleNum="dsChar" color="#FF0000" bold="1"/>
222+
<itemData name="String Char" defStyleNum="dsChar" color="#FF0000"/>
269223
<itemData name="Character" defStyleNum="dsChar" color="#FF0000"/>
270-
<itemData name="Macro" defStyleNum="dsOthers"/>
271-
<itemData name="Attribute" defStyleNum="dsOthers"/>
272-
<itemData name="Lifetime" defStyleNum="dsOthers" bold="1"/>
273-
<itemData name="Error" defStyleNum="dsError"/>
274224
</itemDatas>
275225
</highlighting>
276226
<general>

branches/auto/src/libcore/io.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ pub trait ReaderUtil {
7878
/// Read len bytes into a new vec.
7979
fn read_bytes(&self, len: uint) -> ~[u8];
8080

81-
/// Read up until a specified character (which is not returned) or EOF.
82-
fn read_until(&self, c: char) -> ~str;
83-
8481
/// Read up until the first '\n' char (which is not returned), or EOF.
8582
fn read_line(&self) -> ~str;
8683

@@ -184,22 +181,16 @@ impl<T:Reader> ReaderUtil for T {
184181
bytes
185182
}
186183

187-
fn read_until(&self, c: char) -> ~str {
184+
fn read_line(&self) -> ~str {
188185
let mut bytes = ~[];
189186
loop {
190187
let ch = self.read_byte();
191-
if ch == -1 || ch == c as int {
192-
break;
193-
}
188+
if ch == -1 || ch == 10 { break; }
194189
bytes.push(ch as u8);
195190
}
196191
str::from_bytes(bytes)
197192
}
198193

199-
fn read_line(&self) -> ~str {
200-
self.read_until('\n')
201-
}
202-
203194
fn read_chars(&self, n: uint) -> ~[char] {
204195
// returns the (consumed offset, n_req), appends characters to &chars
205196
fn chars_from_bytes<T:Reader>(bytes: &~[u8], chars: &mut ~[char])
@@ -271,7 +262,12 @@ impl<T:Reader> ReaderUtil for T {
271262
}
272263

273264
fn read_c_str(&self) -> ~str {
274-
self.read_until(0 as char)
265+
let mut bytes: ~[u8] = ~[];
266+
loop {
267+
let ch = self.read_byte();
268+
if ch < 1 { break; } else { bytes.push(ch as u8); }
269+
}
270+
str::from_bytes(bytes)
275271
}
276272

277273
fn read_whole_stream(&self) -> ~[u8] {

branches/auto/src/libsyntax/ext/base.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ pub fn syntax_expander_table() -> SyntaxEnv {
155155
syntax_expanders.insert(@~"deriving_iter_bytes",
156156
@SE(ItemDecorator(
157157
ext::deriving::expand_deriving_iter_bytes)));
158+
syntax_expanders.insert(@~"deriving_clone",
159+
@SE(ItemDecorator(
160+
ext::deriving::expand_deriving_clone)));
158161

159162
// Quasi-quoting expanders
160163
syntax_expanders.insert(@~"quote_tokens",

0 commit comments

Comments
 (0)