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.h
More file actions
53 lines (45 loc) · 1.44 KB
/
comment.h
File metadata and controls
53 lines (45 loc) · 1.44 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
#ifndef LIB_RUBY_PARSER_COMMENT_H
#define LIB_RUBY_PARSER_COMMENT_H
#include <stddef.h>
#include "loc.h"
/// @defgroup comments Comments
/// @brief Everything related to source comments
/// @{
/// @}
/// @brief Equivalent of `lib_ruby_parser::source::CommentType`
/// @ingroup comments
typedef enum
{
/// Inline variant (like `# foo`)
LIB_RUBY_PARSER_COMMENT_TYPE_INLINE,
/// Document variant (like `=begin ... =end`)
LIB_RUBY_PARSER_COMMENT_TYPE_DOCUMENT,
/// Unknown variant
LIB_RUBY_PARSER_COMMENT_TYPE_UNKNOWN,
} LIB_RUBY_PARSER_CommentType;
/// @brief Equivalent of `lib_ruby_parser::source::Comment`
/// @ingroup comments
typedef struct
{
/// Location of the comment
LIB_RUBY_PARSER_Loc location;
/// Kind of the comment (inline/document/unknown)
LIB_RUBY_PARSER_CommentType kind;
} LIB_RUBY_PARSER_Comment;
/// @brief Equivalent of `Vec<lib_ruby_parser::source::Comment>`
/// @ingroup comments
typedef struct
{
/// Capacity
size_t capacity;
/// Pointer to beginning of the comments list
LIB_RUBY_PARSER_Comment *ptr;
/// Length of the array
size_t len;
} LIB_RUBY_PARSER_CommentList;
/// @brief CommentList destructor.
/// Just like Rust/C++ destructor it performs cleanup of "embedded" resources.
/// i.e. it doesn't call `free` on a given pointer.
/// @ingroup comments
void LIB_RUBY_PARSER_drop_comment_list(LIB_RUBY_PARSER_CommentList *comment_list);
#endif // LIB_RUBY_PARSER_COMMENT_H