I want to know a field if it does not match a certain string:
Case 1: When the previous node is not *_pcm.h
, then l1
gives the path to file l2
.
Case 2: When there is no l1
or case 1
is not true, then l
is what I need
visit(sec) {
// case 1
case \sources(_, "_SOURCES", [*_, l1:\sourceList(_, _, _, p:/_pcm.h/i, _, _),
l2:\sourceList(_, _, _, n:/_pcm.c/i, _, _), *_]): {
name = determinePath(p, n, f);
}
// case 2
case \sources(_, "_SOURCES", [*_, l:\sourceList(_, _, _, n:/_pcm.c/i, _, _) , *_]): {
path = getPath(f);
}
}
Instead of p:/_pcm.h/i
I tried p:!/_pcm.h/i
but this does not work