You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the confusing title, I'm trying to use the terminology from the grammar.
An example:
// a metavariable declaration (or just rule)@ rule @expression x, yposition p1, p2@@// transformation section// note there are two @ in this line
foo(x@p1, y@p2)
// another metavariable declaration// cocci.vim doesn't recognize this as a CocciGroup region@@expression foo@@
(Note that when writing this issue, I marked this code fence as cocci, and whatever syntax highlighter GitHub uses seemed to highlight this correctly.)
As you can see in this image, cocci.vim thinks that the two @ are part of a metavariable declaration (rule):
However, if we require that the metavariable declaration (rule) @ start at the beginning of the line...
diff --git a/syntax/cocci.vim b/syntax/cocci.vim
index 9bf7a98..b5bc2d9 100644
--- a/syntax/cocci.vim+++ b/syntax/cocci.vim@@ -14,7 +14,7 @@ syn keyword CocciKeywords statement function local list fresh position ide
syn keyword CocciKeywords declaration declarer attribute symbol format assignment contained
syn keyword CocciKeywords operator global field initializer initialiser iterator name contained
-syn region CocciGroup matchgroup=CocciGroupDelim start="@[^@]*@" end="@@" contains=CocciKeywords+syn region CocciGroup matchgroup=CocciGroupDelim start="^@[^@]*@" end="^@@" contains=CocciKeywords
syn match CocciLineRemoved "^-.*"
syn match CocciLineAdded "^+.*"
...then everything looks fine:
It's not clear to me from looking at the grammar if the @has to start at the beginning of a line (I've never been good wtih BNF). However, every Coccinelle example I've ever seen is as such.
The text was updated successfully, but these errors were encountered:
Sorry for the confusing title, I'm trying to use the terminology from the grammar.
An example:
(Note that when writing this issue, I marked this code fence as
cocci
, and whatever syntax highlighter GitHub uses seemed to highlight this correctly.)As you can see in this image,
cocci.vim
thinks that the two@
are part of a metavariable declaration (rule):However, if we require that the metavariable declaration (rule)
@
start at the beginning of the line......then everything looks fine:
It's not clear to me from looking at the grammar if the
@
has to start at the beginning of a line (I've never been good wtih BNF). However, every Coccinelle example I've ever seen is as such.The text was updated successfully, but these errors were encountered: