summaryrefslogtreecommitdiff
path: root/syntax/olang.vim
diff options
context:
space:
mode:
Diffstat (limited to 'syntax/olang.vim')
-rw-r--r--syntax/olang.vim35
1 files changed, 35 insertions, 0 deletions
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"