summary refs log tree commit diff stats
path: root/tests/vm/tnimnode.nim
diff options
context:
space:
mode:
authorFredrik Høisæther Rasch <fredrik.rasch@gmail.com>2017-05-31 13:08:08 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-05-31 13:08:08 +0200
commit6652ae97414f6806fde57ef252e548795f469262 (patch)
tree54508f1522154470354d62550fb6ae443df1a0a8 /tests/vm/tnimnode.nim
parenteb83ec2685f5bbd0d65051b1f00502f05a367172 (diff)
downloadNim-6652ae97414f6806fde57ef252e548795f469262.tar.gz
Creating and setting comment nodes in macros (#5850)
* strVal assingnable comment statement ast nodes
* Set comment instead of strVal for comment nodes
* Added test code for creating and setting comment nodes
* Modified the AST spec documentation for documentation comments
Diffstat (limited to 'tests/vm/tnimnode.nim')
-rw-r--r--tests/vm/tnimnode.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/vm/tnimnode.nim b/tests/vm/tnimnode.nim
index cca03cd62..e5a41e3c2 100644
--- a/tests/vm/tnimnode.nim
+++ b/tests/vm/tnimnode.nim
@@ -72,3 +72,11 @@ static:
   echo "OK"
   
 
+static:
+  echo "testing creation of comment node"
+  var docComment: NimNode = newNimNode(nnkCommentStmt)
+  docComment.strVal = "This is a doc comment"
+
+  assertEq repr(docComment), "## This is a doc comment"
+
+  echo "OK"