Skip to content

swift: Support yyfn:throw#540

Merged
skvadrik merged 1 commit into
skvadrik:masterfrom
ScrelliCopter:swift-fnattrs
Mar 23, 2025
Merged

swift: Support yyfn:throw#540
skvadrik merged 1 commit into
skvadrik:masterfrom
ScrelliCopter:swift-fnattrs

Conversation

@ScrelliCopter

Copy link
Copy Markdown
Contributor

Adds support for yyfn:throw to the Swift syntax, allowing the user to throw types that conform to the Error protocol within functions generated by the recursive-functions code model. Non-empty settings of the re2c:yyfn:throw property are appended to generated function definitions between parameters and the return type, and generated function calls are prefixed with "try ".

The 'test/codegen/swift/recursive_functions/advanced.re' test has been updated to test the new functionality as well as demonstrate practical use of throwing functions in the recursive-functions model for handling runtime errors.

Adds support for yyfn:throw to the Swift syntax, allowing the user to throw
types that conform to the Error protocol within functions generated by the
recursive-functions code model. Non-empty settings of the `re2c:yyfn:throw`
property are appended to generated function definitions between parameters
and the return type, and generated function calls are prefixed with "try ".

The 'test/codegen/swift/recursive_functions/advanced.re' test has been updated
to test the new functionality as well as demonstrate practical use of throwing
functions in the recursive-functions model for handling runtime errors.
@skvadrik skvadrik merged commit ac37222 into skvadrik:master Mar 23, 2025
@skvadrik

Copy link
Copy Markdown
Owner

Merged, thank you!

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