Skip to content

Simplify formatter interface #361

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 6 commits into from
Jul 10, 2022
Merged

Simplify formatter interface #361

merged 6 commits into from
Jul 10, 2022

Conversation

athre0z
Copy link
Member

@athre0z athre0z commented Jul 10, 2022

This PR removes the Ex variants of various formatter functions. Their functionality is instead integrated into the non-Ex variant. Having the Ex variants effectively doubled the complexity of our public formatter interface and each only had a single additional argument. This additional argument can trivially be passed with as NULL, which I believe should be intuitive to most seasoned C programmers.

When porting the various examples I varied between using NULL and ZYAN_NULL. I chose one or the other depending on whether the example otherwise prefers Zycore or standard C constructs. We should probably normalize that across all examples at some point.

@athre0z athre0z force-pushed the simplify-formatter-interface branch from 66fe25e to cc08e78 Compare July 10, 2022 17:12
@athre0z athre0z added C-cleanup Category: Cleanup of code and refactoring work A-formatter Area: Formatter P-medium Priority: Medium labels Jul 10, 2022
@athre0z athre0z marked this pull request as ready for review July 10, 2022 17:15
@athre0z athre0z requested a review from flobernd July 10, 2022 17:15
Copy link
Member

@flobernd flobernd left a comment

Choose a reason for hiding this comment

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

LGTM!

@athre0z athre0z merged commit 9413c80 into master Jul 10, 2022
@athre0z athre0z deleted the simplify-formatter-interface branch July 10, 2022 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-formatter Area: Formatter C-cleanup Category: Cleanup of code and refactoring work P-medium Priority: Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants