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
This commit is contained in:
parent
eb83ec2685
commit
6652ae9741
3 changed files with 12 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue