evocation/vim/syntax/evocation.vim
Irene Knapp 24d9dcc942
fixed the vim comment highlighting thing
it needed to be a zero-width assertion, performance notwithstanding

Force-Push: yes
Change-Id: I033e3671401041406c247dcffa6b244c40544fd7
2026-05-25 19:43:02 -07:00

65 lines
3 KiB
VimL

" Don't use keywords, they don't have the correct delimiters.
syn region evocationComment start="\(^\|\s\)\@<=\~\($\|\s\)" 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 match evocationTickWord "\(^\|\s\)\zsL'\s\+\S\+\ze\($\|\s\)"
syn match evocationTickWord "\(^\|\s\)\zsL@'\s\+\S\+\ze\($\|\s\)"
syn match evocationTickWord "\(^\|\s\)\zsL!'\s\+\S\+\ze\($\|\s\)"
syn match evocationStackManipulation "\(^\|\s\)\zs\(swap\|drop\|2drop\|3drop\|ndrop\)\ze\($\|\s\)"
syn match evocationStackManipulation "\(^\|\s\)\zs\(roll\|unroll\|\|3roll\|3unroll\)\ze\($\|\s\)"
syn match evocationStackManipulation "\(^\|\s\)\zs\(dup\|2dup\|\|3dup\|ndup\|over\|pick\)\ze\($\|\s\)"
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 evocationOperator "\(^\|\s\)\zs\(8\|16\|32\)[@!]\ze\($\|\s\)"
syn match evocationLogic "\(^\|\s\)\zs&&\ze\($\|\s\)"
syn match evocationLogic "\(^\|\s\)\zs||\ze\($\|\s\)"
syn match evocationLogic "\(^\|\s\)\zs\(not\)\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 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 match evocationArithmetic "\(^\|\s\)\zs\(negate\|max\|min\)\ze\($\|\s\)"
syn match evocationBlock "\(^\|\s\)\zs[\[\]{};]\ze\($\|\s\)"
syn match evocationBlock "\(^\|\s\)\zs;asm\ze\($\|\s\)"
syn match evocationFlow "\(^\|\s\)\zs\(if\|unless\|if-else\|while\|forever\|exit\|make-immediate\|make-hidden\|make-visible\)\ze\($\|\s\)"
syn match evocationConstantWord "\(^\|\s\)\zs:\S\+\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
hi def link evocationConstantWord Constant