aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorCamil Staps2017-07-21 12:22:38 +0000
committerCamil Staps2017-07-21 12:22:38 +0000
commit99b5afe45622b36fbb6656535c311c63c78a0939 (patch)
treec95cd2e187d9b753cc59dd8de5b5430eb9905d09 /vim
parentFix grammar (diff)
Add vim syntax
Diffstat (limited to 'vim')
-rw-r--r--vim/ftdetect/sil.vim1
-rw-r--r--vim/syntax/sil.vim37
2 files changed, 38 insertions, 0 deletions
diff --git a/vim/ftdetect/sil.vim b/vim/ftdetect/sil.vim
new file mode 100644
index 0000000..f142f8f
--- /dev/null
+++ b/vim/ftdetect/sil.vim
@@ -0,0 +1 @@
+au BufNewFile,BufRead *.sil set filetype=sil
diff --git a/vim/syntax/sil.vim b/vim/syntax/sil.vim
new file mode 100644
index 0000000..7797177
--- /dev/null
+++ b/vim/syntax/sil.vim
@@ -0,0 +1,37 @@
+" Clean syntax file
+" Language: Simple imperative language
+" Author: Camil Staps <info@camilstaps.nl>
+
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+syn include @ABC syntax/abc.vim
+
+syn keyword silConditional if else while
+syn keyword silStatement return
+syn keyword silType Bool Int Void
+
+syn match silOperator "[-~@#$%^?!+*<>\/|&=:.]\+" display
+
+syn match silInteger "\<\d\+\>" display
+syn keyword silBool True False
+
+syn match silABC "|\~.*$" contains=@ABC transparent
+
+hi def link silConditional Conditional
+hi def link silStatement Statement
+hi def link silType Type
+
+hi def link silOperator Operator
+
+hi def link silInteger Number
+hi def link silBool Boolean
+
+let b:current_syntax = 'sil'
+
+let &cpo = s:cpo_save
+unlet s:cpo_save