Skip to content

Simplify formatter interface#361

Merged
athre0z merged 6 commits intomasterfrom
simplify-formatter-interface
Jul 10, 2022
Merged

Simplify formatter interface#361
athre0z merged 6 commits intomasterfrom
simplify-formatter-interface

Conversation

@athre0z
Copy link
Copy Markdown
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
Copy Markdown
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