From f1cce688ccd11b4cde93dab0d2e59242a0e574b3 Mon Sep 17 00:00:00 2001 From: Johnny Richard Date: Mon, 12 Aug 2024 23:30:54 +0200 Subject: syntax: Add basic structure to syntax file Signed-off-by: Johnny Richard --- syntax/olang.vim | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 syntax/olang.vim (limited to 'syntax/olang.vim') diff --git a/syntax/olang.vim b/syntax/olang.vim new file mode 100644 index 0000000..cca62fc --- /dev/null +++ b/syntax/olang.vim @@ -0,0 +1,35 @@ +" Vim syntax file +" Language: O Language +" Maintainer: Johnny Richard + +if exists("b:current_syntax") + finish +endif + +hi link olangFuncName Function +hi link olangFunction Function +hi link olangKeyword Keyword +hi link olangOperator Operator +hi link olangString String +hi link olangType Type + +hi link olangNumber Number +hi link olangDecNumber olangNumber + +hi link olangCommentLine Comment + +syn keyword olangType u32 +syn keyword olangOperator * / + - << >> <= =< % +syn keyword olangKeyword return var val let pub ns +syn keyword olangKeyword fn nextgroup=olangFuncName skipwhite skipempty + +syn match olangDecNumber "\<[[:digit:]]*\>" display +syn match olangFuncName "[[:alpha:]][[:alnum:]]*" display contained + +syn region olangString start=+"+ end=+"+ +syn region olangCommentLine start="#" end="$" + +syn sync minlines=200 +syn sync maxlines=500 + +let b:current_syntax = "olang" -- cgit v1.2.3