summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--vim/ftdetect/evocation.vim1
-rw-r--r--vim/syntax/evocation.vim55
2 files changed, 56 insertions, 0 deletions
diff --git a/vim/ftdetect/evocation.vim b/vim/ftdetect/evocation.vim
new file mode 100644
index 0000000..24c1929
--- /dev/null
+++ b/vim/ftdetect/evocation.vim
@@ -0,0 +1 @@
+au BufRead,BufNewFile *.e set filetype=evocation
diff --git a/vim/syntax/evocation.vim b/vim/syntax/evocation.vim
new file mode 100644
index 0000000..403d046
--- /dev/null
+++ b/vim/syntax/evocation.vim
@@ -0,0 +1,55 @@
+syn region evocationComment start="\(^\|\s\)\zs\~" end="$"
+
+syn region evocationString start=_\(^\|\s\)\zss"\ze\($\|\s\)_ end=_"_
+syn region evocationString start=_\(^\|\s\)\zs\."\ze\($\|\s\)_ end=_"_
+
+syn match evocationColonWord "\(^\|\s\)\zs:\s\+\S\+\ze\($\|\s\)"
+syn match evocationTickWord "\(^\|\s\)\zs'\s\+\S\+\ze\($\|\s\)"
+
+syn keyword evocationStackManipulation swap drop 2drop 3drop ndrop
+syn keyword evocationStackManipulation roll unroll 3roll 3unroll
+syn keyword evocationStackManipulation dup 2dup 3dup ndup over pick
+
+syn match evocationNumber "\(^\|\s\)\zs-\?\d\+\ze\($\|\s\)"
+syn match evocationNumber "\(^\|\s\)\zs-\?0b[01]\+\ze\($\|\s\)"
+syn match evocationNumber "\(^\|\s\)\zs-\?0o[0-7]\+\ze\($\|\s\)"
+syn match evocationNumber "\(^\|\s\)\zs-\?0x[0-9a-fA-F]\+\ze\($\|\s\)"
+
+syn match evocationOperator "\(^\|\s\)\zs[;.,&|@!]\ze\($\|\s\)"
+
+syn match evocationLogic "\(^\|\s\)\zs&&\ze\($\|\s\)"
+syn match evocationLogic "\(^\|\s\)\zs||\ze\($\|\s\)"
+syn keyword evocationLogic not
+
+syn match evocationComparison "\(^\|\s\)\zs!=\ze\($\|\s\)"
+syn match evocationComparison "\(^\|\s\)\zs=\ze\($\|\s\)"
+syn match evocationComparison "\(^\|\s\)\zs>=\ze\($\|\s\)"
+syn match evocationComparison "\(^\|\s\)\zs<=\ze\($\|\s\)"
+syn match evocationComparison "\(^\|\s\)\zs>\ze\($\|\s\)"
+syn match evocationComparison "\(^\|\s\)\zs<\ze\($\|\s\)"
+
+syn match evocationArithmetic "\(^\|\s\)\zs+\ze\($\|\s\)"
+syn match evocationArithmetic "\(^\|\s\)\zs-\ze\($\|\s\)"
+syn match evocationArithmetic "\(^\|\s\)\zs\*\ze\($\|\s\)"
+syn match evocationArithmetic "\(^\|\s\)\zs/%\ze\($\|\s\)"
+syn match evocationArithmetic "\(^\|\s\)\zs1+\ze\($\|\s\)"
+syn match evocationArithmetic "\(^\|\s\)\zs1-\ze\($\|\s\)"
+syn keyword evocationArithmetic negate max min
+
+syn match evocationBlock "\(^\|\s\)\zs[\[\]{}]\ze\($\|\s\)"
+syn match evocationFlow "\(^\|\s\)\zs\(if\|unless\|if-else\|while\|forever\|exit\|make-immediate\|make-hidden\)\ze\($\|\s\)"
+
+
+hi def link evocationComment Comment
+hi def link evocationString String
+hi def link evocationColonWord Identifier
+hi def link evocationTickWord Identifier
+hi def link evocationStackManipulation Constant
+hi def link evocationNumber Number
+hi def link evocationOperator Operator
+hi def link evocationLogic Operator
+hi def link evocationComparison Operator
+hi def link evocationArithmetic Operator
+hi def link evocationBlock Structure
+hi def link evocationFlow Structure
+