fix #13491 #17279 runnableExamples now don't get lost in translation (#17282)

* fix #13491 runnableExamples rendering
* fix a runnableExamples thanks to this bugfix
This commit is contained in:
Timothee Cour 2021-03-08 22:09:24 -08:00 • committed by GitHub
commit d161d27cdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 70 additions and 27 deletions

View file

@ -54,7 +54,6 @@ proc createProcType(p, b: NimNode): NimNode {.compileTime.} =
macro `=>`*(p, b: untyped): untyped =
## Syntax sugar for anonymous procedures. It also supports pragmas.
# TODO: xxx pending #13491: uncomment in runnableExamples
runnableExamples:
proc passTwoAndTwo(f: (int, int) -> int): int = f(2, 2)
@ -69,8 +68,8 @@ macro `=>`*(p, b: untyped): untyped =
myBot.call = (name: string) {.noSideEffect.} => "Hello " & name & ", I'm a bot."
assert myBot.call("John") == "Hello John, I'm a bot."
# let f = () => (discard) # simplest proc that returns void
# f()
let f = () => (discard) # simplest proc that returns void
f()
var
params = @[ident"auto"]