weggli icon indicating copy to clipboard operation
weggli copied to clipboard

How to write a rule if keywords are in the code

Open Cossack9989 opened this issue 2 years ago • 1 comments

e.g

void test()
{
__asm__ __volatile__ ("mov xxxxxx");
}

I queryed with '{__asm__ __volatile__ ();}' but nothing was matched. Can weggli query correctly if keywords such as __volatile__ are in the code?

Cossack9989 avatar Jul 07 '23 14:07 Cossack9989

Your example worked without issue for me.

~
❯ cat c.c
void test()
{
__asm__ __volatile__ ("mov xxxxxx");
}

~
❯ weggli '{__asm__ __volatile__();}' c.c
/home/martijn/c.c:1
void test()
{
__asm__ __volatile__ ("mov xxxxxx");

mcourteaux avatar Nov 25 '24 10:11 mcourteaux