]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(dtrace): handle DTrace probe highlighting before action blocks
authorVladimír Marek <vlmarek13@gmail.com>
Mon, 22 Jun 2026 19:55:32 +0000 (19:55 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 22 Jun 2026 19:55:32 +0000 (19:55 +0000)
Recognize DTrace probe descriptions that are followed immediately by an
action block, such as:

    BEGIN{ trace(1); }
    syscall::open:entry{ trace(1); }

The fourth probe field now consumes the remaining non-whitespace text, and
the lookahead allows zero or more whitespace before the following token.

closes: #20560

Signed-off-by: Vladimír Marek <vlmarek13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/dtrace.vim

index 392fa1c1c997a372d0dd8574221b1c546d5644e0..fcaa216fa7d9a43099e537edbe74a5cd65869af1 100644 (file)
@@ -4,6 +4,7 @@
 "           http://docs.sun.com/app/docs/doc/817-6223
 " Version: 1.5
 " Last Change: 2008/04/05
+" 2026 Jun 22 by Vim project: handle DTrace probe descriptions that are followed immediately by an action block
 " Maintainer: Nicolas Weber <nicolasweber@gmx.de>
 
 " dtrace lexer and parser are at
@@ -35,8 +36,8 @@ syn match dtraceComment "\%^#!.*-s.*"
 " XXX: This allows a probe description to end with ',', even if it's not
 " followed by another probe.
 " XXX: This doesn't work if followed by a comment.
-let s:oneProbe = '\%(BEGIN\|END\|ERROR\|\S\{-}:\S\{-}:\S\{-}:\S\{-}\)\_s*'
-exec 'syn match dtraceProbe "'.s:oneProbe.'\%(,\_s*'.s:oneProbe.'\)*\ze\_s\%({\|\/[^*]\|\%$\)"'
+let s:oneProbe = '\%(BEGIN\|END\|ERROR\|\S\{-}:\S\{-}:\S\{-}:\S*\)\_s*'
+exec 'syn match dtraceProbe "'.s:oneProbe.'\%(,\_s*'.s:oneProbe.'\)*\ze\_s*\%({\|\/[^*]\|\_s*\S\|\%$\)"'
 
 " Note: We have to be careful to not make this match /* */ comments.
 " Also be careful not to eat `c = a / b; b = a / 2;`. We use the same