changeset 28510:a3ea758870dc stable

new comment_elt predicates * comment-list.h (comment_elt::is_block, comment_elt::is_full_line, comment_elt::is_end_of_line, comment_elt::is_doc_string, comment_elt::is_copyright): New functions.
author John W. Eaton <jwe@octave.org>
date Fri, 29 May 2020 11:00:41 -0400
parents 06bc2f0bf760
children 59dfd9ed72a3
files libinterp/parse-tree/comment-list.h
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/comment-list.h	Thu May 28 12:00:24 2020 -0400
+++ b/libinterp/parse-tree/comment-list.h	Fri May 29 11:00:41 2020 -0400
@@ -76,6 +76,12 @@
 
     comment_type type (void) const { return m_type; }
 
+    bool is_block (void) const { return m_type == block; }
+    bool is_full_line (void) const { return m_type == full_line; }
+    bool is_end_of_line (void) const { return m_type == end_of_line; }
+    bool is_doc_string (void) const { return m_type == doc_string; }
+    bool is_copyright (void) const { return m_type == copyright; }
+
     ~comment_elt (void) = default;
 
   private: