Add default constructor for Symbol
SymbolTable should probably have different methods for adding a Symbol to the table, instead of [] operator.
This commit is contained in:
parent
425e1f8907
commit
3adce8313c
@ -7,6 +7,7 @@
|
||||
|
||||
namespace query {
|
||||
struct Symbol {
|
||||
Symbol() {}
|
||||
Symbol(std::string& name, int position) : name_(name), position_(position) {}
|
||||
std::string name_;
|
||||
int position_;
|
||||
@ -19,10 +20,6 @@ class SymbolTable {
|
||||
return Symbol(name, position);
|
||||
}
|
||||
|
||||
void AssignSymbol(const Tree& tree, Symbol symbol) {
|
||||
table_[tree.uid()] = symbol;
|
||||
}
|
||||
|
||||
auto& operator[](const Tree& tree) { return table_[tree.uid()]; }
|
||||
|
||||
int max_position() const { return position_; }
|
||||
|
Loading…
Reference in New Issue
Block a user