Skip to content

Commit

Permalink
Add docs to properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-wanna-M committed Aug 5, 2024
1 parent 2e8885c commit b60d9fb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/formatron/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def __init__(self, capture_name: typing.Optional[str] = None):

@property
def capture_name(self) -> typing.Optional[str]:
"""
Get the name of the capture, or `None` if the extractor does not capture.
"""
return self._capture_name

@abc.abstractmethod
Expand All @@ -34,6 +37,9 @@ def extract(self, input_str: str) -> typing.Optional[tuple[str, typing.Any]]:
@property
@abc.abstractmethod
def kbnf_representation(self) -> str:
"""
Get the KBNF representation of the extractor in the generated grammar of a Formatter.
"""
pass

def __str__(self):
Expand Down

0 comments on commit b60d9fb

Please sign in to comment.