Return a reference with the ParseTree::getComponents() method.
This commit is contained in:
parent
5972f0ef4c
commit
24195f9a6c
|
@ -18,7 +18,7 @@ class ParseTree {
|
||||||
protected:
|
protected:
|
||||||
vector<ParseComponent> subComponents;
|
vector<ParseComponent> subComponents;
|
||||||
public:
|
public:
|
||||||
auto getComponents() { return subComponents; }
|
auto& getComponents() { return subComponents; }
|
||||||
void add(const ParseComponent component) { subComponents.emplace_back(component); };
|
void add(const ParseComponent component) { subComponents.emplace_back(component); };
|
||||||
void addAll(const vector<ParseComponent>& components) { for (const auto& comp: components) add(comp); }
|
void addAll(const vector<ParseComponent>& components) { for (const auto& comp: components) add(comp); }
|
||||||
ParseTree(): subComponents() {};
|
ParseTree(): subComponents() {};
|
||||||
|
|
Loading…
Reference in New Issue