Skip to content

swift: Support yyfn:throw #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2025
Merged

Conversation

ScrelliCopter
Copy link
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
16 checks passed
@skvadrik
Copy link
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