Line data Source code
1 : #include "stax/parser/ast.hpp"
2 :
3 : namespace stax::parser {
4 :
5 4 : FunctionDeclaration::FunctionDeclaration(
6 : const DataType& return_type, const Identifier& function_name,
7 : const std::vector<VariableDeclaration>& args,
8 4 : const std::optional<utils::Box<BlockStatement>>& block)
9 4 : : return_type(return_type),
10 4 : name(function_name),
11 4 : args(args),
12 8 : block(std::move(block)) {}
13 :
14 0 : auto PrefixExpression::operator==(const PrefixExpression& other) const -> bool {
15 0 : return op == other.op && operand == other.operand;
16 : }
17 :
18 1 : auto InfixExpression::operator==(const InfixExpression& other) const -> bool {
19 1 : return op == other.op && lhs == other.lhs && rhs == other.rhs;
20 : }
21 :
22 : } // namespace stax::parser
|