Skip to content

Commit

Permalink
Bug fix: literals passed to FormatterBuilder now implements __str__
Browse files Browse the repository at this point in the history
… correctly
  • Loading branch information
Dan-wanna-M committed Aug 22, 2024
1 parent 1b96892 commit d8a9275
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "formatron"
version = "0.3.1"
version = "0.3.2"
authors = [
{name = "Xintong Sun", email = "[email protected]"},
]
Expand Down
3 changes: 3 additions & 0 deletions src/formatron/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def extract(self, input_str: str) -> typing.Optional[tuple[str, typing.Any]]:
def kbnf_representation(self) -> str:
return repr(self._literal)

def __str__(self):
return f"${{{self.kbnf_representation}}}"


class RegexExtractor(Extractor):
"""
Expand Down

0 comments on commit d8a9275

Please sign in to comment.