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

stdlib: clean up coloredResult #962

Merged
merged 1 commit into from
Oct 14, 2023

Conversation

zerbina
Copy link
Collaborator

@zerbina zerbina commented Oct 14, 2023

Summary

Slightly refactor the implementation of the colortext.coloredResult
template and remove its obsolete endResult helper template.

Details

  • mention the injected addf routine in the documentation
  • remove the unnecessary static block around the .error directive
  • shorten the compile-time error message for when no result variable
    exists
  • remove the endResult helper template; the vmgen bug that
    necessitated it is fixed
  • turn the addf procedure into a template and mark it as .used,
    preventing XDeclaredButNotUsed warnings

Summary
=======

Slightly refactor the implementation of the `colortext.coloredResult`
template and remove its obsolete `endResult` helper template.

Details
=======

- mention the injected `addf` routine in the documentation
- remove the unnecessary `static` block around the `.error` directive
- shorten the compile-time error message for when no `result` variable
  exists
- remove the `endResult` helper template; the `vmgen` bug that
  necessitated it is fixed
- turn the `addf` procedure into a template and mark it as `.used`,
  preventing `XDeclaredButNotUsed` warnings
@zerbina zerbina added refactor Implementation refactor stdlib Standard library labels Oct 14, 2023
@saem
Copy link
Collaborator

saem commented Oct 14, 2023

/merge

@github-actions
Copy link

Merge requested by: @saem

Contents after the first section break of the PR description has been removed and preserved below:


Notes for Reviewers

  • found while fixing all the XDeclaredButNotUsed warnings

@chore-runner chore-runner bot enabled auto-merge October 14, 2023 20:25
@chore-runner chore-runner bot added this pull request to the merge queue Oct 14, 2023
Merged via the queue into nim-works:devel with commit a0ce294 Oct 14, 2023
18 checks passed
@zerbina zerbina deleted the stdlib-clean-up-coloredResult branch October 15, 2023 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Implementation refactor stdlib Standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants