]> git.lizzy.rs Git - rust.git/commitdiff
Fixed vim highlighting for \' (and other) escapes in char literals
authorJacob Parker <j3parker@csclub.uwaterloo.ca>
Sun, 25 Mar 2012 20:26:48 +0000 (16:26 -0400)
committerJacob Parker <j3parker@csclub.uwaterloo.ca>
Sun, 25 Mar 2012 20:26:48 +0000 (16:26 -0400)
src/etc/vim/syntax/rust.vim

index aa3412a381322f9c6056407f536b450a712d4cfe..26bb0d704173b21b97179a039b830a94ce435101 100644 (file)
@@ -46,9 +46,10 @@ syn match    rustFloat               display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
 "floating point number, without dot, with exponent
 syn match      rustFloat               display contained "\d\+e[-+]\=\d\+[fl]\=\>"
 
-syn match   rustCharacter   "'[^']*'"
-
 syn case match
+
+syn match   rustCharacter   "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'"
+
 syn region    rustComment     start="/\*" end="\*/" contains=rustComment
 syn region    rustComment     start="//" skip="\\$" end="$" keepend