7 Commits

Author SHA1 Message Date
Mario Zechner
dbd2c2bb37 Improve spine-c-new codegen array scanner and type handling
- Fix array scanner to properly handle primitive pointer types (e.g., Array<float*>)
- Add comprehensive multi-level pointer detection and error reporting
- Improve const type checking to prevent false positives
- Extract reusable warnings collector for consistent error formatting
- Add checks for problematic array types (const elements, template parameters)
- Sort array specializations by category (primitives, enums, pointers)
- Export isPrimitive function and ArraySpecialization interface
- Move array type regex to module level for performance
- Fix discriminated union types for Exclusion and Member interfaces
2025-07-09 11:26:12 +02:00
Mario Zechner
e324cf5cb1 [c] Port type extractor to TypeScript and improve codegen
- Ported extract-spine-cpp-types.js to TypeScript in type-extractor.ts
- Improved type interfaces with discriminated unions for better type safety
- Added proper isConst tracking for const-qualified methods
- Fixed exclusions to check method.isConst instead of return type
- Removed special type mappings (utf8, spine_void) - primitives pass through unchanged
- Made toCTypeName strict with proper error handling
- Documented all conversion functions with examples
- Excluded SpineObject from extraction (matches JS behavior)
- Removed original JS extractor as it's now replaced by TypeScript version

The TypeScript extractor produces identical output (107 files, 164 types) while providing better type information including isConst for methods and consistent isStatic fields.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 02:27:20 +02:00
Mario Zechner
22ea76db1b [c] Port type extractor to TypeScript and improve codegen
- Ported extract-spine-cpp-types.js to TypeScript in type-extractor.ts
- Improved type interfaces with discriminated unions for better type safety
- Added proper isConst tracking for const-qualified methods
- Fixed exclusions to check method.isConst instead of return type
- Removed special type mappings (utf8, spine_void) - primitives pass through unchanged
- Made toCTypeName strict with proper error handling
- Documented all conversion functions with examples
- Excluded SpineObject from extraction (matches JS behavior)
- Removed original JS extractor as it's now replaced by TypeScript version

The TypeScript extractor produces identical output (107 files, 164 types) while providing better type information including isConst for methods and consistent isStatic fields.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 01:50:41 +02:00
Mario Zechner
0a33247f44 Fix exclusions.ts: discriminated union type, correct const method handling 2025-07-08 23:38:43 +02:00
Mario Zechner
4fd23d3abe [c] Codegen improvements. 2025-07-08 23:34:17 +02:00
Mario Zechner
759434e461 [c] Fix abstract type detection and improve codegen filtering
- Always set isAbstract to boolean in extract-spine-cpp-types.js
- Check for inherited pure virtual methods after inheritance pass
- Include abstract classes but skip create() function generation
- Only exclude template classes from code generation
- Extract const/non-const conflict checking into separate function
- Remove unused OpaqueTypeGenerator and helper functions
2025-07-08 23:08:48 +02:00
Mario Zechner
c75fd64189 [cpp] First pass of C wrapper generator and generated sources, WIP 2025-07-08 14:34:10 +02:00