This repository was archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcomment.hpp
More file actions
57 lines (45 loc) · 1.34 KB
/
comment.hpp
File metadata and controls
57 lines (45 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef LIB_RUBY_PARSER_COMMENT_HPP
#define LIB_RUBY_PARSER_COMMENT_HPP
#include <cstddef>
#include "loc.hpp"
namespace lib_ruby_parser
{
/// Equivalent of `lib_ruby_parser::source::CommentType`
enum class CommentType
{
INLINE,
DOCUMENT,
UNKNOWN,
};
/// Equivalent of `lib_ruby_parser::source::Comment`
class Comment
{
public:
/// Location of the comment
Loc location;
/// Kind of the comment (inline/document/unknown)
CommentType kind;
Comment() = delete;
Comment(Loc location, CommentType kind);
Comment(const Comment &) = default;
Comment &operator=(Comment const &) = default;
Comment(Comment &&) = default;
Comment &operator=(Comment &&) = default;
};
/// Equivalent of `Vec<lib_ruby_parser::source::Comment>`
class CommentList
{
public:
Comment *ptr;
size_t capacity;
size_t len;
CommentList() = delete;
CommentList(Comment *ptr, size_t len, size_t capacity);
~CommentList();
CommentList(const CommentList &) = delete;
CommentList &operator=(CommentList const &) = delete;
CommentList(CommentList &&);
CommentList &operator=(CommentList &&);
};
} // namespace lib_ruby_parser
#endif // LIB_RUBY_PARSER_COMMENT_HPP