Skip to content

Commit

Permalink
add regions, unicode idents, attributes to GtkSourceView language-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
sp3d committed Jul 15, 2013
1 parent db438ad commit 9adad22
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang
Expand Up @@ -19,8 +19,9 @@
<style id="type" _name="Data Type" map-to="def:type"/>
<style id="constant" _name="Constant" map-to="def:constant"/>
<style id="identifier" _name="Identifier" map-to="def:identifier"/>
<style id="number" _name="Number" map-to="def:decimal"/>
<style id="number" _name="Number" map-to="def:number"/>
<style id="scope" _name="Scope" map-to="def:preprocessor"/>
<style id="attribute" _name="Attribute" map-to="def:preprocessor"/>
</styles>

<definitions>
Expand Down Expand Up @@ -216,9 +217,19 @@
</match>
</context>

<define-regex id="ident" extended="true">
([^[:cntrl:][:space:][:punct:][:digit:]]|_)([^[:cntrl:][:punct:][:space:]]|_)*
</define-regex>

<context id="scope" style-ref="scope">
<match extended="true">
[a-zA-Z_][a-zA-Z0-9_]*::
\%{ident}::
</match>
</context>

<context id="lifetime" style-ref="keyword">
<match extended="true">
'\%{ident}
</match>
</context>

Expand All @@ -231,12 +242,23 @@
</include>
</context>

<context id="char" style-ref="char" end-at-line-end="true" class="char" class-disabled="no-spell-check">
<start>'</start>
<end>'</end>
<include>
<context ref="def:escape"/>
</include>
<define-regex id="hex_digit" extended="true">
[0-9a-fA-F]
</define-regex>

<define-regex id="common_escape" extended="true">
(n|r|t)|
x\%{hex_digit}{2}|
u\%{hex_digit}{4}|
U\%{hex_digit}{8}
</define-regex>

<context id="char" style-ref="char" class="char">
<match extended="true">'([^\\]|\\\%{common_escape})'</match>
</context>

<context id="attribute" style-ref="attribute" class="attribute">
<match extended="true">\#\[[^\]]+\]</match>
</context>

<context id="rust" class="no-spell-check">
Expand All @@ -255,6 +277,8 @@
<context ref="scope"/>
<context ref="string"/>
<context ref="char"/>
<context ref="lifetime"/>
<context ref="attribute"/>
</include>
</context>

Expand Down

5 comments on commit 9adad22

@bors
Copy link
Contributor

@bors bors commented on 9adad22 Jul 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from z0w0
at sp3d@9adad22

@bors
Copy link
Contributor

@bors bors commented on 9adad22 Jul 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging sp3d/rust/master = 9adad22 into auto

@bors
Copy link
Contributor

@bors bors commented on 9adad22 Jul 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sp3d/rust/master = 9adad22 merged ok, testing candidate = fd80291

@bors
Copy link
Contributor

@bors bors commented on 9adad22 Jul 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = fd80291

Please sign in to comment.