develooper Front page | perl.perl5.porters | Postings from January 2018

Re: [perl #132474] signature parsing API function

Thread Previous | Thread Next
Paul "LeoNerd" Evans
January 18, 2018 18:46
Re: [perl #132474] signature parsing API function
Message ID:
On Mon, 20 Nov 2017 07:06:06 -0800
Zefram (via RT) <> wrote:

> It would be nice to have a C API function for parsing subroutine
> signatures, along the lines of the existing parse_fullstmt() et al.
> This would be particularly useful for CPAN modules that implement
> some variant kind of subroutine, where it should be reasonably easy to
> incorporate all parts of the baseline syntax for subroutine bodies.
> The original implementation of signatures did have a procedural
> interface for parsing them:
>     OP *parse_subsignature(void);
> You call it after lexing the opening "(" of the signature, it parses
> the interior, returns with the lexer facing either the ")" or a
> syntax error, and returns the ops that perform the argument checking
> and unwrapping.

I'd very much like such a function indeed, so I can call it from the
Future::AsyncAwait keyword implementation.


> I'm satisfied with the calling convention of the original
> parse_subsignature(), for the purpose of a parsing API.  Note that it
> can exist as an API regardless of which way the parsing is implemented
> internally.
> It is arguable that having such an API function should be a
> prerequisite for removing experimental status from signatures.
> However, the other parse_*() functions are still experimental in
> their own right.

So, what's required to make this exist then? Beyond "sit and wait for
it", what can I do to assist?

Paul "LeoNerd" Evans      |  |

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About