From 66ba18f9105deaa6eb077251db7a7d67d0e4be97 Mon Sep 17 00:00:00 2001 From: Helge Sverre Date: Sat, 1 Aug 2026 00:47:16 +0200 Subject: [PATCH 1/2] feat: highlight workflow policy forms --- syntax/sema.vim | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/syntax/sema.vim b/syntax/sema.vim index 2da9a8c..4298eb9 100644 --- a/syntax/sema.vim +++ b/syntax/sema.vim @@ -48,7 +48,7 @@ syn keyword semaSpecial let let* letrec begin progn do while and or syn keyword semaSpecial let-values let*-values define-values define-syntax syn keyword semaSpecial match match* defmulti defmethod async await syn keyword semaSpecial set! quote quasiquote unquote unquote-splicing -syn keyword semaSpecial define-record-type defmacro defagent deftool +syn keyword semaSpecial define-record-type defmacro defagent deftool defworkflow defpolicy syn keyword semaSpecial try catch throw syn keyword semaSpecial import module export load syn keyword semaSpecial delay force eval macroexpand with-budget else @@ -62,8 +62,8 @@ syn match semaDefineVar /\v\(%(define|def)\s+\zs[a-zA-Z!$%&*+\-./:<=>?@^~_][a-zA " (define (name ...) ...) — function definition syn match semaDefineFun /\v\(%(define|def)\s+\(\zs[a-zA-Z!$%&*+\-./:<=>?@^~_][a-zA-Z0-9!$%&*+\-./:<=>?@^~_]*/ -" (defun name ...) / (defmacro name ...) / (defagent name ...) / (deftool name ...) -syn match semaDefineFun /\v\(%(defun|defn|defmacro|defmulti|defmethod|defagent|deftool)\s+\zs[a-zA-Z!$%&*+\-./:<=>?@^~_][a-zA-Z0-9!$%&*+\-./:<=>?@^~_]*/ +" Named definition forms +syn match semaDefineFun /\v\(%(defun|defn|defmacro|defmulti|defmethod|defagent|deftool|defworkflow|defpolicy)\s+\zs[a-zA-Z!$%&*+\-./:<=>?@^~_][a-zA-Z0-9!$%&*+\-./:<=>?@^~_]*/ " (set! name value) syn match semaSetTarget /\v\(set!\s+\zs[a-zA-Z!$%&*+\-./:<=>?@^~_][a-zA-Z0-9!$%&*+\-./:<=>?@^~_]*/ @@ -140,6 +140,7 @@ syn match semaBuiltin /\v/ syn match semaBuiltin /\v/ syn match semaBuiltin /\v/ syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ " I/O syn keyword semaBuiltin display print println newline format read @@ -443,6 +444,25 @@ syn match semaBuiltin /\v/ syn match semaBuiltin /\v/ syn match semaBuiltin /\v/ +" Workflow and policy forms +syn keyword semaBuiltin approval checkpoint parallel phase pipeline step +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ +syn match semaBuiltin /\v/ + " Terminal functions syn match semaBuiltin /\v/ syn match semaBuiltin /\v/ From b3c0d0561a6f3d2ac0d1e9dfe924859fde69b6ed Mon Sep 17 00:00:00 2001 From: Helge Sverre Date: Tue, 4 Aug 2026 09:10:00 +0200 Subject: [PATCH 2/2] fix: add defworkflow, defpolicy, and policy/without to lispwords The branch highlights defpolicy as a definition head in syntax/sema.vim but left lispwords untouched, so defpolicy bodies indented as function call arguments instead of as a body. policy/without has the same shape (one distinguished argument plus a body). defworkflow was already missing before this branch; fixed in the same edit so vim matches emacs-sema indent-1-forms. iskeyword already includes /, so the slash-named form works here. --- ftplugin/sema.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/ftplugin/sema.vim b/ftplugin/sema.vim index 41d4d51..7b92538 100644 --- a/ftplugin/sema.vim +++ b/ftplugin/sema.vim @@ -11,6 +11,7 @@ setlocal lispwords+=let,let*,letrec,begin,progn,do,while setlocal lispwords+=let-values,let*-values,define-values,define-syntax setlocal lispwords+=match,match*,defmulti,defmethod,async,await setlocal lispwords+=define-record-type,defmacro,defagent,deftool +setlocal lispwords+=defworkflow,defpolicy,policy/without setlocal lispwords+=try,catch setlocal lispwords+=module setlocal lispwords+=set!,throw,import,load,delay,force