uncomment

uncomment the codes at the compile time

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-22 05:28

Installation

nimble install uncomment
choosenim install uncomment
git clone https://github.com/hamidb80/uncomment

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
uncomment - - - - - - -

Source

Repository https://github.com/hamidb80/uncomment
Homepage https://github.com/hamidb80/uncomment
Registry Source nimble_official

README

About

comment any code that you don't wanna see, the code will be uncommented at the compile time!

Philosophy:

probably sometimes you faced with something like this:

proc admin_page(...)=

  ...

  logger.info fmt"user {...} logged in"

  ...

  logger.info fmt"user {...} uploaded a virus"

  ...

  try:
    ...
  except:
    logger.debug fmt"user {...} wanted to do ... but failed because of {getCurrentErrorMsg()}"

as you can see, there may be a lot of lines that just logs what happens in the system, this might distract you from the actual logic.

what if you could comment that lines of codes [well the point is the commented codes become less distractive, thanks to the syntax-highlighting], and more focus on the actual logic?

well thanks to the powerful macro system [and me ofcourse 😎] you can do this!

Usage

NOTE: use ## and not # for target comments

static prefix

  • usage: {.uncomment.}

set uncommentPrefix constant using -d:uncommentPrefix="!! ". the default value is ">> ".

proc your_Very_Special_Proc(...){.uncomment.}=
  ## >> echo "hey!"
  ...
  ## >> echo "hey again!"

custom prefix for every proc

  • usage: {.uncommentWith: "...".}
proc your_Very_Special_Proc(...){.uncommentWith: "!! ".}=
  ## !! echo "hey!"
  ...
  ## >> echo "won't be uncommented"

?? prefix for debug builds

When the ?? prefix is used, the operators will not be uncommented in release and danger builds.

proc your_proc_with_release_flag(...) {.uncomment.} =
  ## >> echo "hey!"
  ...
  ## ?? echo "won't be uncommented"