Refactored Caching, Refactored BnfNodeParser, Introduced Sphinx

This commit is contained in:
2020-05-12 17:21:10 +02:00
parent 7d3a490bc5
commit 6e343ba996
110 changed files with 13865 additions and 7540 deletions
+5
View File
@@ -4,6 +4,11 @@ from printer.FormatInstructions import FormatDetailDesc, FormatDetailType, Forma
class Formatter:
def __init__(self):
self.custom_l_formats = None
self.custom_d_formats = None
self.reset_formats()
def reset_formats(self):
self.custom_l_formats = {}
self.custom_d_formats = []
+5
View File
@@ -29,10 +29,15 @@ class SheerkaPrinter:
self.sheerka = sheerka
self.formatter = Formatter()
self.formatter.register_format_l(EXECUTION_CONTEXT_CLASS, "[{id:3}] %tab%{desc} ({status})")
self.custom_concepts_printers = None
self.reset()
def reset(self):
self.custom_concepts_printers = {
str(BuiltinConcepts.EXPLANATION): self.print_explanation,
str(BuiltinConcepts.RETURN_VALUE): self.print_return_value,
}
self.formatter.reset_formats()
def register_custom_printer(self, concept, custom_format):
key = concept.key if isinstance(concept, Concept) else concept