Skip to content

Commit 2cf3c3e

Browse files
authored
Merge pull request #79867 from jerryjrchen/update-vim-syntax
Match freestanding macros in vim syntax
2 parents e056c63 + 2ffccc2 commit 2cf3c3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

utils/vim/syntax/swift.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ syn match swiftTupleIndexNumber contains=swiftDecimal
207207
syn match swiftDecimal contained
208208
\ /[0-9]\+/
209209

210+
" This is a superset of the Preproc macros below, so it must come FIRST
211+
syn match swiftFreestandingMacro
212+
\ /#\<[A-Za-z_][A-Za-z_0-9]*\>/
210213
syn match swiftPreproc
211214
\ /#\(\<column\>\|\<dsohandle\>\|\<file\>\|\<line\>\|\<function\>\)/
212215
syn match swiftPreproc
@@ -271,6 +274,7 @@ hi def link swiftLabel Operator
271274
hi def link swiftMutating Statement
272275
hi def link swiftPreproc PreCondit
273276
hi def link swiftPreprocFalse Comment
277+
hi def link swiftFreestandingMacro Macro
274278
hi def link swiftAttribute Type
275279
hi def link swiftTodo Todo
276280
hi def link swiftNil Constant

0 commit comments

Comments
 (0)