Refactored parsers to introduce priority

This commit is contained in:
2020-01-08 19:45:54 +01:00
parent b4346b5af0
commit a62c1f0f13
13 changed files with 531 additions and 42 deletions
+4 -1
View File
@@ -227,7 +227,10 @@ class ParserResultConcept(Concept):
self.set_prop("try_parsed", try_parsed) # in case of error, what was found before the error
def __repr__(self):
return f"ParserResult({self.body})"
text = f"ParserResult(parser={self.props['parser'].value}"
source = self.props['source'].value
text += f", source='{source}')" if source else f", body='{self.body}')"
return text
def __eq__(self, other):
if not isinstance(other, ParserResultConcept):