@@ -180,70 +180,70 @@ class lvalue_node final : public node
180
180
};
181
181
182
182
/* *
183
- * @brief The expression node
183
+ * @brief The rvalue node
184
184
*
185
- * An expression can be one or many of an lvalue, or rvalue
185
+ * Holds a pointer to its data expression
186
186
*
187
187
*/
188
- class expression_node final : public node
188
+ class rvalue_node final : public node
189
189
{
190
190
public:
191
- using datatype =
192
- std::vector<std::variant<std::monostate, lvalue_node, rvalue_node>>;
193
191
/* *
194
- * @brief Construct a new expression node
192
+ * @brief Construct a new rvalue node
195
193
*
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
198
196
*/
199
- explicit expression_node (std::string type, datatype expr )
197
+ explicit rvalue_node (std::string type, std::string rvalue )
200
198
: type_(std::move(type))
201
- , expr_(std::move(expr))
199
+ , rvalue_(std::move(rvalue))
200
+
202
201
{
203
202
}
204
203
205
204
/* *
206
- * @brief The expression node print function
205
+ * @brief The rvalue node print function
207
206
*
208
207
*/
209
208
void print () const override ;
210
209
211
210
private:
212
211
std::string type_;
213
- datatype expr_ ;
212
+ std::string rvalue_ ;
214
213
};
215
214
216
215
/* *
217
- * @brief The rvalue node
216
+ * @brief The expression node
218
217
*
219
- * Holds a pointer to its data expression
218
+ * An expression can be one or many of an lvalue, or rvalue
220
219
*
221
220
*/
222
- class rvalue_node final : public node
221
+ class expression_node final : public node
223
222
{
224
223
public:
224
+ using datatype =
225
+ std::vector<std::variant<std::monostate, lvalue_node, rvalue_node>>;
225
226
/* *
226
- * @brief Construct a new rvalue node
227
+ * @brief Construct a new expression node
227
228
*
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
230
231
*/
231
- explicit rvalue_node (std::string type, std::string rvalue )
232
+ explicit expression_node (std::string type, datatype expr )
232
233
: type_(std::move(type))
233
- , rvalue_(std::move(rvalue))
234
-
234
+ , expr_(std::move(expr))
235
235
{
236
236
}
237
237
238
238
/* *
239
- * @brief The rvalue node print function
239
+ * @brief The expression node print function
240
240
*
241
241
*/
242
242
void print () const override ;
243
243
244
244
private:
245
245
std::string type_;
246
- std::string rvalue_ ;
246
+ datatype expr_ ;
247
247
};
248
248
249
249
/* *
@@ -286,5 +286,4 @@ class statement_node final : public node
286
286
};
287
287
288
288
} // namespace ast
289
-
290
289
} // namespace roxas
0 commit comments