| 1962 | const C_EXITS = new Set(['return_statement', 'break_statement', 'continue_statement', 'goto_statement', 'throw_statement']); |
| 1963 | |
| 1964 | function cAlwaysExits(node: SyntaxNode | null): boolean { |
| 1965 | if (!node) return false; |
| 1966 | if (C_EXITS.has(node.type)) return true; |
| 1967 | if (node.type === 'compound_statement') return cAlwaysExits(lastNamed(node)); |
| 1968 | if (node.type === 'expression_statement') { |
| 1969 | const call = node.namedChild(0); |
| 1970 | const fn = call?.type === 'call_expression' ? call.childForFieldName('function')?.text : ''; |
| 1971 | return fn === 'exit' || fn === '_exit' || fn === 'abort' || fn === 'longjmp'; |
| 1972 | } |
| 1973 | return false; |
| 1974 | } |
| 1975 | |
| 1976 | const C: Rules = { |
| 1977 | boundaries: new Set([ |