Skip to content

Commit

Permalink
Changed FilterNode and HeaderIndexNode to inherit from IndexNode
Browse files Browse the repository at this point in the history
  • Loading branch information
MadsVind committed May 1, 2024
1 parent c587940 commit cbf5300
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion include/src/ast/nodes/AllNodeIncludes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <ProgNode.hpp>
#include <ReturnNode.hpp>
#include <TableNode.hpp>
#include <UnaryExprNode.hpp>
#include <UnionExprNode.hpp>
#include <WhileNode.hpp>

Expand Down
6 changes: 3 additions & 3 deletions include/src/ast/nodes/FilterNode.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef FILTERNODE_HPP
#define FILTERNODE_HPP

#include <BinaryNode.hpp>
#include <IndexNode.hpp>

class FilterNode : public BinaryNode {
class FilterNode : public IndexNode {
public:
FilterNode(std::shared_ptr<AstNode> parent) : BinaryNode(std::move(parent)) {}
FilterNode(std::shared_ptr<AstNode> parent) : IndexNode(std::move(parent)) {}

void accept(std::shared_ptr<AstVisitor> visitor) override {
visitor->visit(std::static_pointer_cast<FilterNode>(shared_from_this()));
Expand Down
6 changes: 3 additions & 3 deletions include/src/ast/nodes/HeaderIndexNode.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef HEADERINDEXNODE_HPP
#define HEADERINDEXNODE_HPP

#include <BinaryNode.hpp>
#include <IndexNode.hpp>

class HeaderIndexNode : public BinaryNode {
class HeaderIndexNode : public IndexNode {
public:
HeaderIndexNode(std::shared_ptr<AstNode> parent) : BinaryNode(std::move(parent)) {}
HeaderIndexNode(std::shared_ptr<AstNode> parent) : IndexNode(std::move(parent)) {}

void accept(std::shared_ptr<AstVisitor> visitor) override {
visitor->visit(std::static_pointer_cast<HeaderIndexNode>(shared_from_this()));
Expand Down
16 changes: 8 additions & 8 deletions tests/ast/ReplaceWithParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@ AST_TEST("replace_with.dpl") {
DplParser::RuleAssignstm,
DplLexer::Identifier,
DplParser::RuleUnaryexpr,
DplLexer::None,
DplParser::RuleHeaderindex,
DplLexer::String,
DplLexer::Identifier,
DplLexer::String,
DplLexer::None,
DplParser::RuleAssignstm,
DplParser::RuleHeaderindex,
DplLexer::String,
DplLexer::Identifier,
DplLexer::String,
DplParser::RuleMultexpr,
DplParser::RuleHeaderindex,
DplLexer::String,
DplLexer::Identifier,
DplParser::RuleHeaderindex,
DplLexer::String,
DplParser::RuleHeaderindex,
DplLexer::Identifier,
DplLexer::String,
DplParser::RuleAssignstm,
DplLexer::Identifier,
DplParser::RuleHeaderindex,
DplLexer::String,
DplParser::RuleUnaryexpr,
DplLexer::None,
DplParser::RuleHeaderindex,
DplLexer::String,
DplLexer::Identifier,
DplLexer::String,
DplLexer::None,
DplLexer::String,
DplParser::RuleProccall,
DplLexer::Identifier,
DplLexer::Identifier,
Expand Down

0 comments on commit cbf5300

Please sign in to comment.