Skip to content

Commit 05268ba

Browse files
committed
chore(ast): clang compiler improvements
1 parent ae25fb7 commit 05268ba

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

roxas/ast.h

+23-24
Original file line numberDiff line numberDiff line change
@@ -180,70 +180,70 @@ class lvalue_node final : public node
180180
};
181181

182182
/**
183-
* @brief The expression node
183+
* @brief The rvalue node
184184
*
185-
* An expression can be one or many of an lvalue, or rvalue
185+
* Holds a pointer to its data expression
186186
*
187187
*/
188-
class expression_node final : public node
188+
class rvalue_node final : public node
189189
{
190190
public:
191-
using datatype =
192-
std::vector<std::variant<std::monostate, lvalue_node, rvalue_node>>;
193191
/**
194-
* @brief Construct a new expression node
192+
* @brief Construct a new rvalue node
195193
*
196-
* @param type expression type, per the grammar
197-
* @param expr the lvalue or rvalue of the expression
194+
* @param type rvalue type, per te grammar
195+
* @param node the rvalue expression
198196
*/
199-
explicit expression_node(std::string type, datatype expr)
197+
explicit rvalue_node(std::string type, std::string rvalue)
200198
: type_(std::move(type))
201-
, expr_(std::move(expr))
199+
, rvalue_(std::move(rvalue))
200+
202201
{
203202
}
204203

205204
/**
206-
* @brief The expression node print function
205+
* @brief The rvalue node print function
207206
*
208207
*/
209208
void print() const override;
210209

211210
private:
212211
std::string type_;
213-
datatype expr_;
212+
std::string rvalue_;
214213
};
215214

216215
/**
217-
* @brief The rvalue node
216+
* @brief The expression node
218217
*
219-
* Holds a pointer to its data expression
218+
* An expression can be one or many of an lvalue, or rvalue
220219
*
221220
*/
222-
class rvalue_node final : public node
221+
class expression_node final : public node
223222
{
224223
public:
224+
using datatype =
225+
std::vector<std::variant<std::monostate, lvalue_node, rvalue_node>>;
225226
/**
226-
* @brief Construct a new rvalue node
227+
* @brief Construct a new expression node
227228
*
228-
* @param type rvalue type, per te grammar
229-
* @param node the rvalue expression
229+
* @param type expression type, per the grammar
230+
* @param expr the lvalue or rvalue of the expression
230231
*/
231-
explicit rvalue_node(std::string type, std::string rvalue)
232+
explicit expression_node(std::string type, datatype expr)
232233
: type_(std::move(type))
233-
, rvalue_(std::move(rvalue))
234-
234+
, expr_(std::move(expr))
235235
{
236236
}
237237

238238
/**
239-
* @brief The rvalue node print function
239+
* @brief The expression node print function
240240
*
241241
*/
242242
void print() const override;
243243

244244
private:
245245
std::string type_;
246-
std::string rvalue_;
246+
datatype expr_;
247247
};
248248

249249
/**
@@ -286,5 +286,4 @@ class statement_node final : public node
286286
};
287287

288288
} // namespace ast
289-
290289
} // namespace roxas

0 commit comments

Comments
 (0)