(node: c_ast.Struct)
| 218 | |
| 219 | |
| 220 | def _decl_type_to_str(decl) -> str: |
| 221 | if isinstance(decl, (c_ast.PtrDecl, c_ast.ArrayDecl)): |
| 222 | return _type_to_str(decl) |
| 223 | if isinstance(decl, c_ast.TypeDecl): |
| 224 | return _type_to_str(decl.type) |
| 225 | if isinstance(decl, c_ast.FuncDecl): |
| 226 | return "void *" |
| 227 | return _type_to_str(decl) |
| 228 | |
| 229 | |
| 230 | def _extract_struct(node: c_ast.Struct) -> StructDef | None: |
| 231 | if not node.decls: |
| 232 | return None |
| 233 | fields = [] |
| 234 | for decl in node.decls: |
| 235 | fname = decl.name or "" |
no test coverage detected