psyclone.psyir.commentable_mixin#

This module contains the CommentableMixin implementation.

Classes#

  • CommentableMixin: Mixin that adds the Commentable trait into a PSyIR node. It provides

class psyclone.psyir.commentable_mixin.CommentableMixin[source]#

Mixin that adds the Commentable trait into a PSyIR node. It provides two attributes that store preceding and inline comments and their respective property getters and setters.

Inheritance

Inheritance diagram of CommentableMixin
append_preceding_comment(comment)[source]#
Parameters:

comment (str) – comment to append after an newline in this statement-preceding comment.

Raises:

TypeError – if the comment is not a string.

property inline_comment#
Returns:

inline comment associated with this statement.

Return type:

str

property preceding_comment#
Returns:

comment preceding this statement.

Return type:

str