From f997c36cc053547a312d499cf96db028369e9e6d Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Tue, 19 Mar 2024 10:00:25 +0100 Subject: [PATCH] RakuAST: ignore =finish if there is no code 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). --- src/Raku/Actions.nqp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Raku/Actions.nqp b/src/Raku/Actions.nqp index 7812d1f88d..6b8c85c6f3 100644 --- a/src/Raku/Actions.nqp +++ b/src/Raku/Actions.nqp @@ -3260,7 +3260,7 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions { } method doc-block:sym($/) { - $*CU.replace-finish-content(~$); + $*CU.replace-finish-content(~$) if $*CU; } method doc-block:sym($/) {