summary refs log tree commit diff stats
path: root/tests/macros
diff options
context:
space:
mode:
authornc-x <neelesh.chandola@outlook.com>2019-08-18 15:21:28 +0530
committerArne Döring <arne.doering@gmx.net>2019-08-18 11:51:28 +0200
commitd5840e1e3d186a3b54859f3b1609b96975748372 (patch)
treea7dde3b2e34536c80521d5fb14e72c4635a54985 /tests/macros
parent7cb31455ee949ee006e2f314daa74866cf37a74e (diff)
downloadNim-d5840e1e3d186a3b54859f3b1609b96975748372.tar.gz
Implement isExported for symbols in macros (#11963)
* Implement isExported for macros

* Reimplement isExported using VM callback mechanism

* VM does not support exceptions, use stacktrace() instead.
Diffstat (limited to 'tests/macros')
-rw-r--r--tests/macros/tisexported.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/macros/tisexported.nim b/tests/macros/tisexported.nim
new file mode 100644
index 000000000..53766edf5
--- /dev/null
+++ b/tests/macros/tisexported.nim
@@ -0,0 +1,10 @@
+import macros
+
+proc t1* = discard
+proc t2 = discard
+
+macro check(p1: typed, p2: typed) =
+  doAssert isExported(p1) == true
+  doAssert isExported(p2) == false
+
+check t1, t2