Skip to content

Commit 2965047

Browse files
committed
Remove special 'box' placement syntax handling
- RFC 809 has been unapproved for quite awhile. We don't need to highlight syntax that we are not going to support. - The original implementation does not work correctly, and did balance delimiters properly. Fixes #355.
1 parent 0dabf6a commit 2965047

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

syntax/rust.vim

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ syn match rustAssert "\<assert\(\w\)*!" contained
3434
syn match rustPanic "\<panic\(\w\)*!" contained
3535
syn match rustAsync "\<async\%(\s\|\n\)\@="
3636
syn keyword rustKeyword break
37-
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
37+
syn keyword rustKeyword box
3838
syn keyword rustKeyword continue
3939
syn keyword rustKeyword crate
4040
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
@@ -66,14 +66,6 @@ syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipw
6666
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
6767
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
6868

69-
syn region rustBoxPlacement matchgroup=rustBoxPlacementParens start="(" end=")" contains=TOP contained
70-
" Ideally we'd have syntax rules set up to match arbitrary expressions. Since
71-
" we don't, we'll just define temporary contained rules to handle balancing
72-
" delimiters.
73-
syn region rustBoxPlacementBalance start="(" end=")" containedin=rustBoxPlacement transparent
74-
syn region rustBoxPlacementBalance start="\[" end="\]" containedin=rustBoxPlacement transparent
75-
" {} are handled by rustFoldBraces
76-
7769
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=rustMacroRepeatCount
7870
syn match rustMacroRepeatCount ".\?[*+]" contained
7971
syn match rustMacroVariable "$\w\+"
@@ -350,7 +342,6 @@ hi def link rustLifetime Special
350342
hi def link rustLabel Label
351343
hi def link rustExternCrate rustKeyword
352344
hi def link rustObsoleteExternMod Error
353-
hi def link rustBoxPlacementParens Delimiter
354345
hi def link rustQuestionMark Special
355346
hi def link rustAsync rustKeyword
356347
hi def link rustAwait rustKeyword

0 commit comments

Comments
 (0)