aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-09 10:40:02 +0200
committerlemon <lsof@mailbox.org>2022-08-09 10:40:02 +0200
commitd0fc961eeb2cf69b50edc83aae90fcebc3a0677f (patch)
tree868788ad7c186c31277389ef5d3394da640d2cb3 /misc
parentdddbdcbeb41777c1e98e37281dddd6f3c89a1280 (diff)
vim syntax
Diffstat (limited to 'misc')
-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