From e1b5c02916ed9b248f9afcc4260b231e6e03202a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 19 Aug 2012 09:31:05 -0500 Subject: allow "fun Foo::foo ..." --- Fun.xs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Fun.xs') diff --git a/Fun.xs b/Fun.xs index 9488c80..e808cd7 100644 --- a/Fun.xs +++ b/Fun.xs @@ -248,8 +248,18 @@ static OP *parse_fun(pTHX_ GV *namegv, SV *psobj, U32 *flagsp) floor = start_subparse(0, CVf_ANON); lex_read_space(0); - if (isIDFIRST(*(PL_parser->bufptr))) { - function_name = parse_idword(""); + if (isIDFIRST(*(PL_parser->bufptr)) || *(PL_parser->bufptr) == ':') { + function_name = sv_2mortal(newSVpvs("")); + while (isIDFIRST(*(PL_parser->bufptr)) || *(PL_parser->bufptr) == ':') { + if (lex_peek_unichar(0) == ':') { + demand_unichar(':', DEMAND_IMMEDIATE); + demand_unichar(':', DEMAND_IMMEDIATE); + sv_catpvs(function_name, "::"); + } + else { + sv_catsv(function_name, parse_idword("")); + } + } } lex_read_space(0); -- cgit v1.2.3-54-g00ecf