Skip to content

Commit 491623e

Browse files
committed
---
yaml --- r: 120554 b: refs/heads/dist-snap c: bf0c6d8 h: refs/heads/master v: v3
1 parent 30d4429 commit 491623e

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
@@ -6,7 +6,7 @@ refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 229338d6ac6b9252ecdb923ffc1ec0d71e3145d5
9+
refs/heads/dist-snap: bf0c6d8166b1b1a3c45a3131a6f019ed8a005a1f
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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)