first commit
This commit is contained in:
commit
d2f10f3bbc
84 changed files with 13382 additions and 0 deletions
22
livedemo/demo.nim
Normal file
22
livedemo/demo.nim
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
import macros
|
||||
|
||||
macro cov(n: untyped): untyped =
|
||||
result = n
|
||||
echo treeRepr n
|
||||
|
||||
cov:
|
||||
proc toTest(x, y: int) =
|
||||
try:
|
||||
case x
|
||||
of 8:
|
||||
if y > 9: echo "8.1"
|
||||
else: echo "8.2"
|
||||
of 9: echo "9"
|
||||
else: echo "foo"
|
||||
echo "no exception"
|
||||
except IoError:
|
||||
echo "IoError"
|
||||
|
||||
toTest(8, 10)
|
||||
toTest(10, 10)
|
||||
Loading…
Add table
Add a link
Reference in a new issue