Open Erotemic opened 2 years ago
A Lark backend allows us to have a well defined grammar for parsing docstrings and extracting doctests.
It might not be faster than the current whatever-i-did-to-get-it-working approach. But mine may have edge cases that a proper grammar would not.
Something like:
start? docstring doctest: indented(python, '>>>') example_item: doctest example_items: list(example_item) args: "Args: " indented(args_items) example: "Example: " indented(example_items) ignore: "Ignore: " indented(text) dockblock: args | example | ignore | benchmark | misc docstring: text | docblock
A Lark backend allows us to have a well defined grammar for parsing docstrings and extracting doctests.
It might not be faster than the current whatever-i-did-to-get-it-working approach. But mine may have edge cases that a proper grammar would not.
Something like: