diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2022-10-14 13:14:47 +0100 |
---|---|---|
committer | Paul Evans <leonerd@leonerd.org.uk> | 2022-10-25 15:49:20 +0100 |
commit | 9a27b4a4d8ed9cce0905c91d78c279be127de229 (patch) | |
tree | 15b03d5eab1248d62d9475a486688f4a0446591c /perly.y | |
parent | db2b17365aa663074617cea8c7795ff608c41295 (diff) | |
download | perl-9a27b4a4d8ed9cce0905c91d78c279be127de229.tar.gz |
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.
Diffstat (limited to 'perly.y')
-rw-r--r-- | perly.y | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; } ; |