Skip to content

Commit

Permalink
Fix a bug in ToString function of Not expression
Browse files Browse the repository at this point in the history
Signed-off-by: Wenbo Li <lwb21@mails.tsinghua.edu.cn>
  • Loading branch information
hnjylwb committed Apr 27, 2024
1 parent b410ab9 commit 338b3c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/operators/expressions/logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ class Logic : public OperatorExpression {
}
}

std::string ToString() const override { return fmt::format("{} {} {}", children_[0], logic_type_, children_[1]); }
std::string ToString() const override {
if (logic_type_ == LogicType::NOT) {
return fmt::format("{} {}", logic_type_, children_[0]);
}
return fmt::format("{} {} {}", children_[0], logic_type_, children_[1]);
}
LogicType GetLogicType() const { return logic_type_; }

private:
Expand Down

0 comments on commit 338b3c1

Please sign in to comment.