Fixed BNF parsing issues

This commit is contained in:
2020-03-10 18:28:11 +01:00
parent b5d56e13f9
commit c9acfa99a1
4 changed files with 77 additions and 15 deletions
+2 -2
View File
@@ -249,7 +249,7 @@ class BnfParser(BaseParser):
# (for example of recursive bnf definition)
if self.context.obj and hasattr(self.context.obj, "name"):
if concept_name == str(self.context.obj.name):
return ConceptExpression(concept_name)
return self.eat_rule_name_if_needed(ConceptExpression(concept_name))
concept = self.context.get_concept(concept_name)
if not self.sheerka.is_known(concept):
@@ -264,7 +264,7 @@ class BnfParser(BaseParser):
expr = ConceptGroupExpression(concept) if self.sheerka.isaset(self.context, concept) \
else ConceptExpression(concept)
expr.rule_name = concept.name
return expr
return self.eat_rule_name_if_needed(expr)
ret = StrMatch(core.utils.strip_quotes(token.value))
self.next_token()