From ee399e457a26223b18b98007404e48531dc21430 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Thu, 7 May 2026 21:53:02 -0700 Subject: add a vim syntax it was time. it was really impressively broken without one. Force-Push: yes Change-Id: Id26c551dcf43b37577ac96796627b6658a040cf4 --- vim/ftdetect/evocation.vim | 1 + vim/syntax/evocation.vim | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 vim/ftdetect/evocation.vim create mode 100644 vim/syntax/evocation.vim (limited to 'vim') 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 + -- cgit 1.4.1