diff options
Diffstat (limited to 'grammer.cpp')
-rw-r--r-- | grammer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/grammer.cpp b/grammer.cpp index 2379e9a..5557b12 100644 --- a/grammer.cpp +++ b/grammer.cpp @@ -230,6 +230,8 @@ bool Compiler::AddRootNode() const auto& variants{bnf[type]}; for (int i = 0; i < variants.size(); i++) { const std::vector<std::string> & variant{variants[i]}; + if (variant.size() == 0) + continue; // TODO: Handle case of empty rule (see e.g. C++ "attribute-list") if (child_type == variant[0]) { if (node_type == "") { node_type = type; |