From ebbe7a1672c5a8750a57019c4df6d259dda12a28 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Thu, 29 Sep 2022 21:06:46 +0200 Subject: Import protocol code generator from xK, add tests Also add a VIM syntax highlighting file. This also fixes some previously untriggered bugs. --- libertyxdr.vim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libertyxdr.vim (limited to 'libertyxdr.vim') diff --git a/libertyxdr.vim b/libertyxdr.vim new file mode 100644 index 0000000..d980d77 --- /dev/null +++ b/libertyxdr.vim @@ -0,0 +1,21 @@ +" filetype.vim: au! BufNewFile,BufRead *.lxdr setf libertyxdr +if exists("b:current_syntax") + finish +endif + +syn match libertyxdrError "[^[:space:]:;,(){}<>=]\+" +syn region libertyxdrBlockComment start=+/[*]+ end=+[*]/+ +syn match libertyxdrComment "//.*" +syn match libertyxdrIdentifier "\<[[:alpha:]][[:alnum:]_]*\>" +syn match libertyxdrNumber "\<0\>\|\(-\|\<\)[1-9][[:digit:]]*\>" +syn keyword libertyxdrKeyword const enum struct union switch case +syn keyword libertyxdrType bool u8 u16 u32 u64 i8 i16 i32 i64 string void + +let b:current_syntax = "libertyxdr" +hi def link libertyxdrError Error +hi def link libertyxdrBlockComment Comment +hi def link libertyxdrComment Comment +hi def link libertyxdrIdentifier Identifier +hi def link libertyxdrNumber Number +hi def link libertyxdrKeyword Statement +hi def link libertyxdrType Type -- cgit v1.2.3-54-g00ecf