fix: __DATA__ no longer causes incomplete documents#377
Draft
toddr-bot wants to merge 2 commits into
Draft
Conversation
Add test data files that verify complete() returns true for documents ending with __DATA__ (with and without content) and __END__. The __DATA__ tests are marked $TODO as they currently fail (GH #185). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PPI::Statement::Data::_complete() returned false, causing complete() to report documents with __DATA__ as incomplete. Like __END__, __DATA__ marks the end of compilable Perl code — a document ending with it is complete. Change _complete() to return true, matching PPI::Statement::End. Fixes #185 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PPI::Statement::Data::_complete()returned false (empty string), causingPPI::Document->complete()to report documents ending with__DATA__as incomplete. Like__END__,__DATA__marks the end of compilable Perl code, so a document ending with it is complete. Changed_complete()to return true, matchingPPI::Statement::End.Fixes #185
Changes
PPI::Statement::Data::_complete()to return1instead of''__END__,__DATA__, and__DATA__with content tot/data/27_complete/Test plan
03y_end.code,04y_data.code,05y_data_with_content.code) that verifycomplete()returns trueGenerated by Kōan /fix
Quality Report
Changes: 4 files changed, 13 insertions(+), 2 deletions(-)
Code scan: clean
Tests: skipped
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline