added possibility of printing nodes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
namespace ast {
|
||||
@@ -9,6 +10,14 @@ namespace ast {
|
||||
virtual ~node() = default;
|
||||
};
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const node& n) {
|
||||
return os << n.str();
|
||||
}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const node* n) {
|
||||
return os << n->str();
|
||||
}
|
||||
|
||||
struct statement : node {};
|
||||
|
||||
struct expression : node {};
|
||||
|
Reference in New Issue
Block a user