Produce AST even when there are parser errors

This commit is contained in:
rocky
2019-08-07 15:25:53 +02:00
committed by chriseth
parent efa2648771
commit 7fd7cc1e76
13 changed files with 209 additions and 84 deletions
+4 -2
View File
@@ -79,13 +79,15 @@ public:
static void listAccept(std::vector<T> const& _list, ASTVisitor& _visitor)
{
for (T const& element: _list)
element->accept(_visitor);
if (element)
element->accept(_visitor);
}
template <class T>
static void listAccept(std::vector<T> const& _list, ASTConstVisitor& _visitor)
{
for (T const& element: _list)
element->accept(_visitor);
if (element)
element->accept(_visitor);
}
/// @returns a copy of the vector containing only the nodes which derive from T.