status-im / nim-confutils

Simplified handling of command line options and config files
Apache License 2.0
64 stars 16 forks source link

Usage of & in the description of the command enum values gives compile error #59

Open kdeme opened 2 years ago

kdeme commented 2 years ago

Compile error:

test_conf.nim(7, 20) Error: Invalid node kind nnkInfix for macros.`$`

Reproduce snippet:

import
  confutils

type
  ExporterCmd* = enum
    exportCommand =
      "This multi " & # This fails
      "line fails"
    printCommand =
      """Multi lines with these
triple quoted strings does work"""

  ExporterConf* = object
    case cmd* {.
      command
      defaultValue: exportCommand .}: ExporterCmd
    of exportCommand:
      discard
    of printCommand:
      discard

when isMainModule:
  let config = ExporterConf.load()