Skip to content

Commit 58c94e2

Browse files
committed
---
yaml --- r: 95467 b: refs/heads/dist-snap c: 58b336d h: refs/heads/master i: 95465: 21ced28 95463: a70b0b4 v: v3
1 parent c95942c commit 58c94e2

File tree

2 files changed

+47
-23
lines changed
  • branches/dist-snap/src/etc/gedit/share/gtksourceview-3.0/language-specs

2 files changed

+47
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: d8d1b8f8be250b9e19bb70aa0968c1b4a4aec2f8
9+
refs/heads/dist-snap: 58b336d90b3155cb42a31de6c914bb784aad47bc
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
<keyword>u64</keyword>
8686
<keyword>f32</keyword>
8787
<keyword>f64</keyword>
88-
<keyword>float</keyword>
8988
<keyword>char</keyword>
9089
<keyword>str</keyword>
9190
<keyword>Either</keyword>
@@ -205,16 +204,36 @@
205204
</include>
206205
</context>
207206

207+
<define-regex id="int_suffix" extended="true">
208+
(i8|i16|i32|i64|i|u8|u16|u32|u64|u)
209+
</define-regex>
210+
211+
<define-regex id="exponent" extended="true">
212+
([eE][+-]?[0-9_]+)
213+
</define-regex>
214+
215+
<define-regex id="float_suffix" extended="true">
216+
(\%{exponent}?(f32|f64)?)|(\.[0-9][0-9_]*\%{exponent}?)?(f32|f64)?|\.
217+
</define-regex>
218+
219+
<define-regex id="num_suffix" extended="true">
220+
\%{int_suffix}|\%{float_suffix}
221+
</define-regex>
222+
223+
<define-regex id="hex_digit" extended="true">
224+
[0-9a-fA-F]
225+
</define-regex>
226+
208227
<context id="number" style-ref="number">
209228
<match extended="true">
210-
(?&lt;![\w\.])
229+
((?&lt;=\.\.)|(?&lt;![\w\.]))
211230
(
212-
0x[0-9a-fA-F_]+(u8|u16|u32|u64|i8|i16|i32|i64|u|i)?|
213-
0b[0-1_]+(u8|u16|u32|u64|i8|i16|i32|i64|u|i)?|
214-
[0-9][0-9_]*\.[0-9_]*([eE][+-]?[0-9_]+)?(f32|f64|f)?|
215-
[0-9][0-9_]*(u8|u16|u32|u64|i8|i16|i32|i64|u|i)?
231+
[1-9][0-9_]*\%{num_suffix}?|
232+
0[0-9_]*\%{num_suffix}?|
233+
0b[01_]+\%{int_suffix}?|
234+
0x(\%{hex_digit}|_)+\%{int_suffix}?
216235
)
217-
(?![\w\.])
236+
((?![\w\.].)|(?=\.\.))
218237
</match>
219238
</context>
220239

@@ -234,32 +253,37 @@
234253
</match>
235254
</context>
236255

256+
<define-regex id="common_escape" extended="true">
257+
'|"|
258+
\\|n|r|t|
259+
x\%{hex_digit}{2}|
260+
u\%{hex_digit}{4}|
261+
U\%{hex_digit}{8}
262+
</define-regex>
263+
264+
<context id="string_escape" style-ref="def:special-char">
265+
<match>\\\%{common_escape}</match>
266+
</context>
267+
237268
<context id="string" style-ref="string" class="string" class-disabled="no-spell-check">
238269
<start>"</start>
239270
<end>"</end>
240271
<include>
241-
<context ref="def:escape"/>
272+
<context ref="string_escape"/>
242273
<context ref="def:line-continue"/>
243274
</include>
244275
</context>
245276

246-
<define-regex id="hex_digit" extended="true">
247-
[0-9a-fA-F]
248-
</define-regex>
249-
250-
<define-regex id="common_escape" extended="true">
251-
(n|r|t)|
252-
x\%{hex_digit}{2}|
253-
u\%{hex_digit}{4}|
254-
U\%{hex_digit}{8}
255-
</define-regex>
256-
257-
<context id="char" style-ref="char" class="char">
258-
<match extended="true">'([^\\]|\\\%{common_escape})'</match>
277+
<context id="char" style-ref="char">
278+
<match extended="true">'([^\\']|\\\%{common_escape})'</match>
259279
</context>
260280

261281
<context id="attribute" style-ref="attribute" class="attribute">
262-
<match extended="true">\#\[[^\]]+\]</match>
282+
<start extended="true">\#\[</start>
283+
<end>\]</end>
284+
<include>
285+
<context ref="def:in-comment"/>
286+
</include>
263287
</context>
264288

265289
<context id="rust" class="no-spell-check">

0 commit comments

Comments
 (0)