From 6652ae97414f6806fde57ef252e548795f469262 Mon Sep 17 00:00:00 2001 From: Fredrik Høisæther Rasch Date: Wed, 31 May 2017 13:08:08 +0200 Subject: 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 --- tests/vm/tnimnode.nim | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/vm/tnimnode.nim') 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" -- cgit 1.4.1-2-gfad0 'sub'>This repository contains the Nim compiler, Nim's stdlib, tools, and documentation. (mirror)ahoang <ahoang@tilde.institute>
summary refs log blame commit diff stats
path: root/changelogs/readme.md
blob: 3ff1e1b7b83ba9f479dbd1977736bf4d3e88a7b7 (plain) (tree)