Skip to content

fix: __DATA__ no longer causes incomplete documents#377

Draft
toddr-bot wants to merge 2 commits into
masterfrom
koan.toddr.bot/fix-issue-185
Draft

fix: __DATA__ no longer causes incomplete documents#377
toddr-bot wants to merge 2 commits into
masterfrom
koan.toddr.bot/fix-issue-185

Conversation

@toddr-bot

@toddr-bot toddr-bot commented Apr 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

PPI::Statement::Data::_complete() returned false (empty string), causing PPI::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, matching PPI::Statement::End.

Fixes #185

Changes

  • Changed PPI::Statement::Data::_complete() to return 1 instead of ''
  • Added test data files for __END__, __DATA__, and __DATA__ with content to t/data/27_complete/

Test plan

  • Added three test files (03y_end.code, 04y_data.code, 05y_data_with_content.code) that verify complete() returns true
  • Full test suite passes (69 files, 53090 tests)

Generated 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

toddr-bot and others added 2 commits April 26, 2026 22:18
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

__DATA__ causes "incomplete" documents

1 participant