examples from the talk part of test suite
This commit is contained in:
parent
a0b82db402
commit
2f0671eb79
9 changed files with 153 additions and 3 deletions
11
examples/talk/quasiquote.nim
Normal file
11
examples/talk/quasiquote.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
import macros
|
||||
|
||||
macro check(ex: expr): stmt =
|
||||
var info = ex.lineinfo
|
||||
var expString = ex.toStrLit
|
||||
result = quote do:
|
||||
if not `ex`:
|
||||
echo `info`, ": Check failed: ", `expString`
|
||||
|
||||
check 1 < 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue