Skip to content

Add enum parsing#5

Merged
FlickerSoul merged 15 commits intomainfrom
dev/enum-parsing
Nov 9, 2025
Merged

Add enum parsing#5
FlickerSoul merged 15 commits intomainfrom
dev/enum-parsing

Conversation

@FlickerSoul
Copy link
Owner

This PR adds the macro of generating declarative parsing for enums

@FlickerSoul FlickerSoul requested a review from Copilot November 8, 2025 02:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for parsing enums with the @ParseEnum macro, refactors test structure to use nested suites, and fixes a typo in an error message. The changes enable binary parsing of enum types with various matching strategies.

Key Changes

  • Added @ParseEnum macro with associated @match, @matchAndTake, and @matchDefault macros for enum case parsing
  • Refactored existing utility functions into shared Constants.swift and Utilities.swift files
  • Reorganized test files into nested test suites under BinaryParseKitMacroTests
  • Fixed spelling error in error message (lietarl → literal)

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Tests/BinaryParseKitMacroTests/Misc.swift Made test utilities private and added enum macros to test macro specs
Tests/BinaryParseKitMacroTests/BinaryParseKitMacroTests.swift Reorganized struct parsing tests into nested suite extension
Tests/BinaryParseKitMacroTests/BinaryParseKitEnumTests.swift Added comprehensive test cases for enum parsing functionality
Sources/BinaryParseKitMacros/Macros/Supports/Utilities.swift Extracted shared parsing code generation utilities
Sources/BinaryParseKitMacros/Macros/Supports/Constants.swift Centralized package constants and member names
Sources/BinaryParseKitMacros/Macros/ParseStruct/*.swift Updated to use centralized constants and shared utilities
Sources/BinaryParseKitMacros/Macros/ParseEnum/*.swift Implemented new enum parsing macro infrastructure
Sources/BinaryParseKit/*.swift Added enum parsing utilities and updated protocol declarations
Package.swift Added Lifetimes experimental feature
.github/workflows/ci.yml Separated linting into dedicated job

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@FlickerSoul FlickerSoul marked this pull request as draft November 8, 2025 13:02
@FlickerSoul FlickerSoul requested a review from Copilot November 9, 2025 00:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@FlickerSoul FlickerSoul marked this pull request as ready for review November 9, 2025 00:33
@FlickerSoul FlickerSoul enabled auto-merge (squash) November 9, 2025 00:33
@FlickerSoul FlickerSoul merged commit fcc304d into main Nov 9, 2025
2 checks passed
@FlickerSoul FlickerSoul deleted the dev/enum-parsing branch November 9, 2025 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants