Skip to content

Commit 8fcb362

Browse files
committed
Add support for documentation strings
1 parent 7d79e68 commit 8fcb362

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.15...3.16)
22

33
project(
44
IR
5-
VERSION 0.11.0
5+
VERSION 0.12.0
66
LANGUAGES CXX)
77

88
configure_file(docs/ReleaseNotes/version.in

docs/ReleaseNotes/v0.12.0.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# News #
2+
3+
## Features ##
4+
5+
* Support for documentation strings in:
6+
* Enum
7+
* Variable
8+
* Function
9+
* Struct

include/IR/ir.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ struct Enum {
7171
std::string m_name;
7272
// Fully qualified name
7373
std::string m_representation;
74+
// Documentation string
75+
std::string m_documentation;
7476
// Unscoped values
7577
std::vector<std::string> m_values;
7678
// True if it was declared as 'enum class'
@@ -101,7 +103,7 @@ struct Type {
101103
// Fully qualified name of the function
102104
std::string m_representation;
103105
};
104-
106+
105107
// Represents a type parameter that is an integral
106108
// E.g. 3 in std::array<int, 3>
107109
struct Integral {};
@@ -134,6 +136,8 @@ struct Type {
134136
struct Variable {
135137
// Name that should be used to access the variable
136138
std::string m_name;
139+
// Documentation string
140+
std::string m_documentation;
137141

138142
Type m_type;
139143
};
@@ -146,6 +150,9 @@ struct Function {
146150
// E.g. MyNamespace::myFunction
147151
std::string m_representation;
148152

153+
// Documentation string
154+
std::string m_documentation;
155+
149156
Type m_returnType;
150157

151158
std::vector<Variable> m_arguments;
@@ -174,6 +181,9 @@ struct Struct {
174181
// E.g. MyNamespace::MyClass
175182
std::string m_representation;
176183

184+
// Documentation string
185+
std::string m_documentation;
186+
177187
StructData m_public;
178188
StructData m_private;
179189
StructData m_protected;

0 commit comments

Comments
 (0)