Skip to content

Commit 3a23952

Browse files
committed
---
yaml --- r: 151905 b: refs/heads/try2 c: bf0c6d8 h: refs/heads/master i: 151903: a97315c v: v3
1 parent 756493c commit 3a23952

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 229338d6ac6b9252ecdb923ffc1ec0d71e3145d5
8+
refs/heads/try2: bf0c6d8166b1b1a3c45a3131a6f019ed8a005a1f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/etc/vim/syntax/rust.vim

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,38 @@ syn keyword rustOperator as
1818

1919
syn match rustAssert "\<assert\(\w\)*!" contained
2020
syn match rustFail "\<fail\(\w\)*!" contained
21-
syn keyword rustKeyword break box continue
22-
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite
21+
syn keyword rustKeyword break
22+
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
23+
syn keyword rustKeyword continue
24+
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
25+
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
2326
syn keyword rustKeyword for in if impl let
2427
syn keyword rustKeyword loop once proc pub
2528
syn keyword rustKeyword return super
2629
syn keyword rustKeyword unsafe virtual while
27-
syn keyword rustKeyword use nextgroup=rustModPath skipwhite
30+
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
2831
" FIXME: Scoped impl's name is also fallen in this category
29-
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite
30-
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite
32+
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
3133
syn keyword rustStorage mut ref static
3234
syn keyword rustObsoleteStorage const
3335

3436
syn keyword rustInvalidBareKeyword crate
3537

36-
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier skipwhite
37-
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite
38+
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier skipwhite skipempty
39+
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty
3840

3941
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
4042
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
4143

44+
syn region rustBoxPlacement matchgroup=rustBoxPlacementParens start="(" end=")" contains=TOP contained
45+
syn keyword rustBoxPlacementExpr GC containedin=rustBoxPlacement
46+
" Ideally we'd have syntax rules set up to match arbitrary expressions. Since
47+
" we don't, we'll just define temporary contained rules to handle balancing
48+
" delimiters.
49+
syn region rustBoxPlacementBalance start="(" end=")" containedin=rustBoxPlacement transparent
50+
syn region rustBoxPlacementBalance start="\[" end="\]" containedin=rustBoxPlacement transparent
51+
" {} are handled by rustFoldBraces
52+
4253
" Reserved (but not yet used) keywords {{{2
4354
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield
4455

@@ -244,6 +255,8 @@ hi def link rustLifetime Special
244255
hi def link rustInvalidBareKeyword Error
245256
hi def link rustExternCrate rustKeyword
246257
hi def link rustObsoleteExternMod Error
258+
hi def link rustBoxPlacementParens Delimiter
259+
hi def link rustBoxPlacementExpr rustKeyword
247260

248261
" Other Suggestions:
249262
" hi rustAttribute ctermfg=cyan

0 commit comments

Comments
 (0)