aboutsummaryrefslogtreecommitdiff
path: root/misc/cff.vim
blob: fe9ff97a5328ce3096367042c28f908c356defc5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
" Vim syntax file
" Language: cff

if exists("b:current_syntax")
   finish
endif


syn keyword Statement return break continue case
syn keyword Repeat for while do if else switch
syn keyword StorageClass typedef fn static def let extern const
syn keyword Include import
syn keyword Macro defmacro
syn keyword Type i8 u8 i16 u16 i32 u32 i64 u64
syn keyword Type int uint isize usize iptrint uptrint
syn keyword Type bool void f32 f64 typeof
syn keyword Structure struct enum union
syn keyword Operator sizeof as not and or

syn match   PreProc "#\i*\>"
syn match   PreProc "#?\>"
syn match PreProc "#'\k\+\>"

syn case ignore
syn match	Number	display transparent "\<\d\|\.\d" contains=cNumber,cFloat
syn match	cNumber		display contained "\d\+\%(\vu|u8|i8|u16|i32|u32|i64|u64|z|zs|p|ps\V\)\?\>"
syn match	cNumber		display contained "0x\x\+\%(\vu|u8|i8|u16|i32|u32|i64|u64|z|zs|p|ps\V\)\?\>"
syn match	cFloat		display contained "\d\+\.\d*\%(f\|f32\|f64\)\?\>"

syn region  Comment start="//" end="$"
syn region	String		start=+"+ skip=+\\\\\|\\"+ end=+"+  extend
syn region	Character	start=+'+ skip=+\\\\\|\\'+ end=+'+  extend