strformat.fmt now supports non-literal const strings (#18274)

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Timothee Cour
2021-06-18 08:57:51 -07:00
committed by GitHub
parent 87cd9b24a3
commit 5600a62229
3 changed files with 43 additions and 27 deletions

View File

@@ -476,8 +476,9 @@ proc genSym*(kind: NimSymKind = nskLet; ident = ""): NimNode {.
## needs to occur in a declaration context.
proc callsite*(): NimNode {.magic: "NCallSite", benign, deprecated:
"Deprecated since v0.18.1; use varargs[untyped] in the macro prototype instead".}
"Deprecated since v0.18.1; use `varargs[untyped]` in the macro prototype instead".}
## Returns the AST of the invocation expression that invoked this macro.
# see https://github.com/nim-lang/RFCs/issues/387 as candidate replacement.
proc toStrLit*(n: NimNode): NimNode =
## Converts the AST `n` to the concrete Nim code and wraps that