Skip to content

Commit

Permalink
RakuAST: ignore =finish if there is no code
Browse files Browse the repository at this point in the history
The =finish construct only makes sense in code.  If it is being used
in a RakuDoc context only, it tried to attach the text to the CompUnit
when there was none, because there was no code.

This now just ignores the =finish text if there is no CompUnit to
attach to.  Potentially, it could also be converted to a RakuDoc,
but this does not actually appear to make sense (yet).
  • Loading branch information
lizmat committed Mar 19, 2024
1 parent b82fa83 commit f997c36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Raku/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -3260,7 +3260,7 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
}

method doc-block:sym<finish>($/) {
$*CU.replace-finish-content(~$<finish>);
$*CU.replace-finish-content(~$<finish>) if $*CU;
}

method doc-block:sym<alias>($/) {
Expand Down

0 comments on commit f997c36

Please sign in to comment.