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

Add PrettyConfig::braced_structs #551

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

juntyr
Copy link
Member

@juntyr juntyr commented Nov 2, 2024

This is just a quick attempt at getting something going for #550. Anyone (e.g. @HKalbasi) is free to pick up my branch and work on this further, I might not have time for more for a while.

  • Add tests, especially for the newtype interaction
  • Add custom error variants / messages
  • Update the extension docs and grammar
  • I've included my change in CHANGELOG.md

@juntyr juntyr changed the title Rusty struct Add a braced_structs extension Nov 2, 2024
src/de/mod.rs Outdated Show resolved Hide resolved
@juntyr
Copy link
Member Author

juntyr commented Nov 2, 2024

Thinking about this some more and the challenges of this implementation draft ... I think this should not be an extension but instead a pretty printing option

  • this would allow all parsers to parse both the parenthesised and the braced syntax
  • it would simplify the parser because it would not need to suddenly make previously allowed cases fail
  • it would not require changes to RawValue
  • as a downside, it would not be possible (immediately) to only parse code that follows the new syntax

@juntyr juntyr changed the title Add a braced_structs extension Add PrettyConfig::braced_structs Nov 3, 2024
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.

1 participant