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 --- compiler/vm.nim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler/vm.nim') diff --git a/compiler/vm.nim b/compiler/vm.nim index e201e98dc..bc5873ff5 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1406,6 +1406,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg = if dest.kind in {nkStrLit..nkTripleStrLit} and regs[rb].kind in {rkNode}: dest.strVal = regs[rb].node.strVal + elif dest.kind == nkCommentStmt: + dest.comment = regs[rb].node.strVal else: stackTrace(c, tos, pc, errFieldXNotFound, "strVal") of opcNNewNimNode: -- cgit 1.4.1-2-gfad0