Give Rule a virtual destructor

Not needed at the moment because rule pointers are are always wrapped
in shared_ptrs. Still, don't want to forget this if I stopped using shared_ptrs
at some point.
This commit is contained in:
Max Brunsfeld 2014-04-27 21:49:56 -07:00
parent b86203d205
commit b2cb78166e
2 changed files with 3 additions and 0 deletions

View file

@ -21,5 +21,7 @@ namespace tree_sitter {
stream << string("#<null-rule>");
return stream;
}
Rule::~Rule() {}
}
}

View file

@ -19,6 +19,7 @@ namespace tree_sitter {
virtual rule_ptr copy() const = 0;
virtual std::string to_string() const = 0;
virtual void accept(Visitor *visitor) const = 0;
virtual ~Rule();
};
std::ostream& operator<<(std::ostream& stream, const Rule &rule);