From 31232f6897e65f98e8520ad75713a0af9976396a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20Steinh=C3=B6fel?= Date: Thu, 29 Jun 2023 10:11:49 +0200 Subject: [PATCH] Fixed bug #2: Assertion failing in wrong way --- pyproject.toml | 2 +- src/grammar_graph/__init__.py | 2 +- src/grammar_graph/gg.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 098c6ff..0abb039 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "grammar_graph" -version = "0.1.14" +version = "0.1.15" authors = [ { name="Dominic Steinhöfel", email="dominic.steinhoefel@cispa.de" }, ] diff --git a/src/grammar_graph/__init__.py b/src/grammar_graph/__init__.py index fb69db9..f3b4574 100644 --- a/src/grammar_graph/__init__.py +++ b/src/grammar_graph/__init__.py @@ -1 +1 @@ -__version__ = "0.1.14" +__version__ = "0.1.15" diff --git a/src/grammar_graph/gg.py b/src/grammar_graph/gg.py index e00f580..3016943 100644 --- a/src/grammar_graph/gg.py +++ b/src/grammar_graph/gg.py @@ -728,7 +728,7 @@ def recurse(label: str) -> Node: new_node = NonterminalNode(label, children_nodes) nonterminal_nodes[label] = new_node - assert grammar[label], f"Grammar has no rules for {label}" + assert label in grammar, f"Grammar has no rules for {label}" for nr, expansion in enumerate(grammar[label]): expansion_children_nodes = [] if len(expansion) == 0: