def _extract_nested_case(case_node, stmts_list):
 if isinstance(case_node.stmts[0], (c_ast.Case, c_ast.Default)):
  stmts_list.append(case_node.stmts.pop())
  _extract_nested_case(stmts_list[(-1)], stmts_list)

def _extract_nested_case ( case_node , stmts_list ) : if isinstance ( case_node . stmts [ 0 ] , ( c_ast . Case , c_ast . Default ) ) : stmts_list . append ( case_node . stmts . pop ( ) ) _extract_nested_case ( stmts_list [ ( - 1 ) ] , stmts_list )
recursively extract consecutive case statements that are made nested by the parser and add them to the stmts_list .