weggli icon indicating copy to clipboard operation
weggli copied to clipboard

Cannot find the switch, case, To<> pattern

Open YizhuoZhai opened this issue 3 years ago • 0 comments

Hi: I'm using the weggli to find the code pattern, but it returns nothing. I wonder if you have any hints for me to solve this problem. The pattern I want to find is :

switch(A) {
  case AA: {
       B = To<C>(D);
  }
}

An example from Chromiun is :

  switch (basic_shape->GetType()) {
    case BasicShape::kBasicShapeCircleType: {
      const BasicShapeCircle* circle = To<BasicShapeCircle>(basic_shape);
      ...
      break;
    }
...
}

The command I use is:

weggli '{
   switch(_) {
	$x=static_cast<_>(_);
   }
}' /path/to/code/

I appreciate any help you can give.

YizhuoZhai avatar Oct 08 '22 03:10 YizhuoZhai