diff options
author | Fredrik Høisæther Rasch <fredrik.rasch@gmail.com> | 2017-05-31 13:08:08 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-05-31 13:08:08 +0200 |
commit | 6652ae97414f6806fde57ef252e548795f469262 (patch) | |
tree | 54508f1522154470354d62550fb6ae443df1a0a8 /compiler/vm.nim | |
parent | eb83ec2685f5bbd0d65051b1f00502f05a367172 (diff) | |
download | Nim-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 'compiler/vm.nim')
-rw-r--r-- | compiler/vm.nim | 2 |
1 files changed, 2 insertions, 0 deletions
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: |