This PR replaces two functions generated by defparser with a single fun def using a default arg. This has the following benefits:
Docs for parsers are now unified
Default args can be used for other parameters
The second benefit is admittedly shady, since in that case you'd always need to provide the first arg (previous parser) to be able to override other defaults.
However, the first benefit reduces the need to write two specs for each parser. It also allows to use e.g. @doc false to suppress doc for some parser. With the master version this is not possible, as @doc will affect only the first created function.
In addition, I added an option to include links to GH repo in the generated docs so it's a bit more easier to see the implementation of some parser, if needed.
I like it! I was always mildly annoyed at the inflexibility of the old approach, though never enough to fix it, thanks for diving in and addressing that!
This PR replaces two functions generated by
defparser
with a single fun def using a default arg. This has the following benefits:The second benefit is admittedly shady, since in that case you'd always need to provide the first arg (previous parser) to be able to override other defaults.
However, the first benefit reduces the need to write two specs for each parser. It also allows to use e.g.
@doc false
to suppress doc for some parser. With the master version this is not possible, as@doc
will affect only the first created function.In addition, I added an option to include links to GH repo in the generated docs so it's a bit more easier to see the implementation of some parser, if needed.