From 85ccf19fa28a94aefb1ce9b70f41f0b4e490db3c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 4 Jun 2023 16:55:09 -0400 Subject: [PATCH] Add syntax highlighting for tagged enums --- syntax/sss.vim | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/syntax/sss.vim b/syntax/sss.vim index c2250e6..de05f4b 100644 --- a/syntax/sss.vim +++ b/syntax/sss.vim @@ -7,6 +7,9 @@ if exists('b:current_syntax') && b:current_syntax == 'sss' finish endif +syn match SSSErrorWord /\i*/ contained +hi def link SSSErrorWord Error + syn match SSSVar /[a-zA-Z_][a-zA-Z_0-9]*/ syn match SSSNumber /0x[0-9a-fA-F_]\+%\?\|[0-9][0-9_]*\(\.\([0-9][0-9_]*\|\.\@!\)\)\?\(e[0-9_]\+\)\?%\?\|\.\@/ end=/(\@=\|$/ contains=SSSFnName,SSSKeyword syn keyword SSSBoolean yes no @@ -118,11 +128,13 @@ syn match SSSTypeDelim /,/ contained hi def link SSSTypeDelim Type syn match SSSAssoc /=/ contained hi def link SSSAssoc Type -syn region SSSType start=/\[/ end=/\]\|$/ contains=SSSType contained nextgroup=SSSTableValueType -syn region SSSType start=/{/ end=/}\|$/ contains=SSSType,SSSAssoc contained nextgroup=SSSTableValueType -syn region SSSType start=/(/ end=/) *-> *\|$/ contains=SSSType,SSSTypeDelim nextgroup=SSSType contained -syn match SSSType /[a-zA-Z_0-9@?]\+/ contained nextgroup=SSSTableValueType -syn match SSSType /\$[a-zA-Z_0-9@?]\+/ contained nextgroup=SSSTableValueType +syn region SSSTypeUnits start=// +hi def link SSSTypeUnits Type +syn region SSSType start=/\[/ end=/\]\|$/ contains=SSSType contained nextgroup=SSSTableValueType,SSSTypeUnits +syn region SSSType start=/{/ end=/}\|$/ contains=SSSType,SSSAssoc contained nextgroup=SSSTableValueType,SSSTypeUnits +syn region SSSType start=/(/ end=/) *->/ contains=SSSType,SSSTypeDelim nextgroup=SSSType contained +syn match SSSType /[a-zA-Z_0-9@?]\+/ contained nextgroup=SSSTableValueType,SSSTypeUnits +syn match SSSType /\$[a-zA-Z_0-9@?]\+/ contained nextgroup=SSSTableValueType,SSSTypeUnits hi def link SSSType Type syn match SSSTypeAnnotation /:\@