From 9a27b4a4d8ed9cce0905c91d78c279be127de229 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Fri, 14 Oct 2022 13:14:47 +0100 Subject: Better handling of builtin CV attributes The previous code would handle subroutine attributes directly against `PL_compcv` as a side-effect of merely parsing the syntax in `yyl_colon()`, an unlikely place for anyone to find it. This complicates the way the parser works. The new structure creates a new function to apply all the builtin attributes out of an attribute list to any given CV, and invokes it from the parser at a slightly better time. --- perly.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'perly.y') diff --git a/perly.y b/perly.y index fe0c717540..00e6266625 100644 --- a/perly.y +++ b/perly.y @@ -709,7 +709,12 @@ proto subattrlist : empty | COLONATTR THING - { $$ = $THING; } + { + OP *attrlist = $THING; + if(attrlist && !PL_parser->sig_seen) + attrlist = apply_builtin_cv_attributes(PL_compcv, attrlist); + $$ = attrlist; + } | COLONATTR { $$ = NULL; } ; -- cgit v1.2.1