This commit is contained in:
Araq 2018-05-02 09:15:32 +02:00
commit eb03d9aafe

View file

@ -278,7 +278,7 @@ template callFormatOption(res, arg, option) {.dirty.} =
macro `&`*(pattern: string): untyped = macro `&`*(pattern: string): untyped =
## For a specification of the ``&`` macro, see the module level documentation. ## For a specification of the ``&`` macro, see the module level documentation.
if pattern.kind notin {nnkStrLit..nnkTripleStrLit}: if pattern.kind notin {nnkStrLit..nnkTripleStrLit}:
error "& only works with string literals", pattern error "string formatting (fmt(), &) only works with string literals", pattern
let f = pattern.strVal let f = pattern.strVal
var i = 0 var i = 0
let res = genSym(nskVar, "fmtRes") let res = genSym(nskVar, "fmtRes")