Fix README custom printer example and abstract printer write method
#72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #71
Describe the change
This PR fixes the issues described in #71:
writemethod in the abstract printer to accept two arguments, matching the way it is called internally.Why are we doing this?
The current README example does not work as written, causing syntax and argument errors for users following it. This change ensures the example is functional and consistent with the abstract printer’s method signature.
Benefits
The documentation and example code now work correctly, making it easier for users to implement a custom printer without encountering errors.
Drawbacks
No drawbacks are expected; this PR only fixes existing issues in the documentation and method signature.
Requirements
masterbranch?EDIT
Marked “Code style checked?”.
Rubocop reports missing class documentation, which is also the case for all other printers, so this is consistent with the existing codebase.
It also warns about unused
writearguments. This is expected, since the method is meant to be overridden, and the implementation ofwritewas not changed in this PR. Keeping the current signature makes the intended usage clear to anyone reading the code. One other alternative would be prefixing each argument with an underscore, but I believe the current version is clearer.Marking the style check as complete because the current form is, in my view, the more inline option with the rest of the project