bugGNU nano - Bugs: bug #48561, improve Rust syntax highlighting

 
 

bug #48561: improve Rust syntax highlighting

Submitted by:  Dirkjan Ochtman <djc>
Submitted on:  Tue 19 Jul 2016 11:21:01 AM UTC  
 
Severity: 2 - MinorStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 21 Jul 2016 09:26:44 AM UTC, comment #2:

Thanks. Pushed to git, 1349c1d.

(In future please use git format-patch; the output of git log -p is not usable with git am.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 20 Jul 2016 06:12:32 PM UTC, comment #1:

Thanks. However, does Rust allow non-ASCII characters in variable names and identifiers? For example, Smørrebrød or Ruža? If yes, then "[A-Z][A-Za-z0-9]+" would not color Ruža, and would not color Smørrebrød when a Danish locale is set. So, a better expression would be: "[[:upper:]][[:alnum:]]+".

If you agree, please attach a comitted and signed-off patch.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 19 Jul 2016 11:21:01 AM UTC, original submission:

Please incorporate this fix (I am the author):

diff --git a/doc/syntax/rust.nanorc b/doc/syntax/rust.nanorc
index c664ce0..0381de6 100644
--- a/doc/syntax/rust.nanorc
+++ b/doc/syntax/rust.nanorc
@@ -20,7 +20,7 @@ color red "[a-z_]+!"
color magenta "[A-Z][A-Z_0-9]+"

# Traits/Enums/Structs/Types/...
-color magenta "[A-Z][a-z0-9]+"
+color magenta "[A-Z][A-Za-z0-9]+"

# Strings
color green "\".*\""

Dirkjan Ochtman <djc>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #37965:  nano-rust-syntax-capitals.patch added by djc (772B - application/octet-stream - Full patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Posted a comment)
  • -unavailable- added by djc (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 30 Jul 2016 09:25:22 AM UTCbensOpen/ClosedOpen=>Closed
    Thu 21 Jul 2016 09:26:44 AM UTCbensStatusNone=>Fixed
      SummaryImprove Rust syntax highlighting=>improve Rust syntax highlighting
    Wed 20 Jul 2016 08:00:51 PM UTCdjcAttached File-=>Added nano-rust-syntax-capitals.patch, #37965
    Wed 20 Jul 2016 06:12:32 PM UTCbensSeverity3 - Normal=>2 - Minor
      Assigned toNone=>bens

    Back to the top


    Powered by Savane 3.1-cleanup1