Skip to content

Commit

Permalink
rust.lang: add i128 & u128, and allow underscores in unicode escapes
Browse files Browse the repository at this point in the history
Changes in Rust highlighting:
* Add missing types (keywords) and missing integer suffixes: `i128` & `u128`
	* https://doc.rust-lang.org/std/primitive.i128.html
	* https://doc.rust-lang.org/std/primitive.u128.html
* Fix: Allow underscores in unicode escapes: rust-lang/rust#43716

Sources:
* Rust documentation: https://doc.rust-lang.org/
* Rust in Vim: https://github.com/rust-lang/rust.vim/blob/master/syntax/rust.vim
* Rust in ACE: https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/rust_highlight_rules.js
  • Loading branch information
nibags authored and Sébastien Wilmet committed Jun 13, 2018
1 parent 472515e commit b755c35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions data/language-specs/rust.lang
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ except according to those terms.
<keyword>i16</keyword>
<keyword>i32</keyword>
<keyword>i64</keyword>
<keyword>i128</keyword>
<keyword>u8</keyword>
<keyword>u16</keyword>
<keyword>u32</keyword>
<keyword>u64</keyword>
<keyword>u128</keyword>
<keyword>f32</keyword>
<keyword>f64</keyword>
<keyword>char</keyword>
Expand All @@ -149,7 +151,7 @@ except according to those terms.
</context>

<define-regex id="int-suffix" extended="true">
(i8|i16|i32|i64|isize|u8|u16|u32|u64|usize)
(i8|i16|i32|i64|i128|isize|u8|u16|u32|u64|u128|usize)
</define-regex>

<define-regex id="exponent" extended="true">
Expand Down Expand Up @@ -230,7 +232,7 @@ except according to those terms.
</define-regex>

<define-regex id="unicode-escape" extended="true">
u{\%{hex-digit}{1,6}}
u{(\%{hex-digit}_*){1,6}}
</define-regex>

<context id="string-escape" style-ref="def:special-char">
Expand Down

0 comments on commit b755c35

Please sign in to comment.