[gtksourceview] rust.lang: add i128 & u128, and allow underscores in unicode escapes



commit b755c35b88fb829db64675906ec2afdc1b310b76
Author: Nibaldo González <nibgonz gmail com>
Date:   Tue Jun 12 21:33:14 2018 -0400

    rust.lang: add i128 & u128, and allow underscores in unicode escapes
    
    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: https://github.com/rust-lang/rust/pull/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

 data/language-specs/rust.lang | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/data/language-specs/rust.lang b/data/language-specs/rust.lang
index 570c1aa4..fbe6e703 100644
--- a/data/language-specs/rust.lang
+++ b/data/language-specs/rust.lang
@@ -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>
@@ -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">
@@ -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">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]