aboutsummaryrefslogtreecommitdiff
path: root/misc/cff.vim
diff options
context:
space:
mode:
Diffstat (limited to 'misc/cff.vim')
-rw-r--r--misc/cff.vim32
1 files changed, 32 insertions, 0 deletions
diff --git a/misc/cff.vim b/misc/cff.vim
new file mode 100644
index 0000000..0cde9d7
--- /dev/null
+++ b/misc/cff.vim
@@ -0,0 +1,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