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 pathmagic_comment.hpp
More file actions
56 lines (45 loc) · 1.5 KB
/
magic_comment.hpp
File metadata and controls
56 lines (45 loc) · 1.5 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
#ifndef LIB_RUBY_PARSER_MAGIC_COMMENT_HPP
#define LIB_RUBY_PARSER_MAGIC_COMMENT_HPP
#include <cstddef>
#include "loc.hpp"
namespace lib_ruby_parser
{
/// Equivalent of `lib_ruby_parser::source::MagicCommentKind`
enum class MagicCommentKind
{
ENCODING,
FROZEN_STRING_LITERAL,
WARN_INDENT,
SHAREABLE_CONSTANT_VALUE,
};
/// Equivalent of `lib_ruby_parser::source::MagicComment`
class MagicComment
{
public:
MagicCommentKind kind;
Loc key_l;
Loc value_l;
MagicComment() = delete;
MagicComment(MagicCommentKind kind, Loc key_l, Loc value_l);
MagicComment(const MagicComment &) = default;
MagicComment &operator=(MagicComment const &) = default;
MagicComment(MagicComment &&) = default;
MagicComment &operator=(MagicComment &&) = default;
};
/// Equivalent of `Vec<lib_ruby_parser::source::MagicComment>`
class MagicCommentList
{
public:
MagicComment *ptr;
size_t capacity;
size_t len;
MagicCommentList() = delete;
MagicCommentList(MagicComment *ptr, size_t len, size_t capacity);
~MagicCommentList();
MagicCommentList(const MagicCommentList &) = delete;
MagicCommentList &operator=(MagicCommentList const &) = delete;
MagicCommentList(MagicCommentList &&);
MagicCommentList &operator=(MagicCommentList &&);
};
} // namespace lib_ruby_parser
#endif // LIB_RUBY_PARSER_MAGIC_COMMENT_HPP