lib-ruby-parser (C++ bindings)  4.0.1+ruby-3.1.1
C++ bindings for lib-ruby-parser library
comment.hpp
Go to the documentation of this file.
1 #ifndef LIB_RUBY_PARSER_COMMENT_HPP
2 #define LIB_RUBY_PARSER_COMMENT_HPP
3 
4 #include <cstddef>
5 #include "loc.hpp"
6 
7 namespace lib_ruby_parser
8 {
10  enum class CommentType
11  {
12  INLINE,
13  DOCUMENT,
14  UNKNOWN,
15  };
16 
18  class Comment
19  {
20  public:
23 
26 
27  Comment() = delete;
29 
30  Comment(const Comment &) = default;
31  Comment &operator=(Comment const &) = default;
32 
33  Comment(Comment &&) = default;
34  Comment &operator=(Comment &&) = default;
35  };
36 
39  {
40  public:
42  size_t capacity;
43  size_t len;
44 
45  CommentList() = delete;
46  CommentList(Comment *ptr, size_t len, size_t capacity);
47  ~CommentList();
48 
49  CommentList(const CommentList &) = delete;
50  CommentList &operator=(CommentList const &) = delete;
51 
54  };
55 } // namespace lib_ruby_parser
56 
57 #endif // LIB_RUBY_PARSER_COMMENT_HPP
lib_ruby_parser::Loc
Loc struct from lib-ruby-parser
Definition: loc.hpp:12
lib_ruby_parser::Comment::location
Loc location
Location of the comment.
Definition: comment.hpp:22
lib_ruby_parser::CommentList::~CommentList
~CommentList()
lib_ruby_parser::CommentType::DOCUMENT
@ DOCUMENT
lib_ruby_parser::CommentList::ptr
Comment * ptr
Definition: comment.hpp:41
lib_ruby_parser::Comment
Equivalent of lib_ruby_parser::source::Comment
Definition: comment.hpp:18
lib_ruby_parser::CommentList::len
size_t len
Definition: comment.hpp:43
lib_ruby_parser::CommentList::operator=
CommentList & operator=(CommentList const &)=delete
lib_ruby_parser::CommentList::CommentList
CommentList()=delete
lib_ruby_parser::Comment::operator=
Comment & operator=(Comment const &)=default
lib_ruby_parser::Comment::Comment
Comment()=delete
lib_ruby_parser::CommentList::capacity
size_t capacity
Definition: comment.hpp:42
lib_ruby_parser::Comment::kind
CommentType kind
Kind of the comment (inline/document/unknown)
Definition: comment.hpp:25
lib_ruby_parser::CommentType
CommentType
Equivalent of lib_ruby_parser::source::CommentType
Definition: comment.hpp:10
lib_ruby_parser
Definition: api.hpp:7
lib_ruby_parser::CommentType::INLINE
@ INLINE
lib_ruby_parser::CommentList
Equivalent of Vec<lib_ruby_parser::source::Comment>
Definition: comment.hpp:38
lib_ruby_parser::CommentType::UNKNOWN
@ UNKNOWN
loc.hpp