Skip to content
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

Convert chained fAround/findOut/eitherWay to try/catch/finally #99

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MaoShizhong
Copy link
Contributor

@MaoShizhong MaoShizhong commented Feb 12, 2025

Closes #60

#88 Has been untouched for a long time and also looks like it doesn't fully cover the desired conversion.

The function/callback syntax was chosen because even though this could be handled by the pre-parser (to allow faround {} findout {} eitherway {} syntax), that would require additional logic to determine if inside a comment so that only intended keywords are substituted. The current approach feels easier to reason about.

This PR

  • Converts chained fAround, findOut and eitherWay functions (eitherWay is optional) to try/catch/(finally) - if not chained then they are treated as normal function calls.
  • Adds tests for conversion.
  • Updates example/compiled/README files with examples.

@christina-de-martinez
Copy link
Owner

Okay ik I'm exceedingly lame for this but I decided I sort of want to keep it PG; could we change it to fAround/findOut/eitherWay? I'm happy to push something up to your branch if you don't feel like doing it. Otherwise this looks great! Awesome work. @MaoShizhong

@MaoShizhong
Copy link
Contributor Author

No problems keeping it PG, probably a more sensible decision :P I'll change it up later when I get the chance!

@MaoShizhong MaoShizhong changed the title Convert chained fuckAround/findOut/eitherWay to try/catch/finally Convert chained fAround/findOut/eitherWay to try/catch/finally Feb 21, 2025
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.

fAround / findOut / eitherWay -> try / catch / finally
2 participants