Skip to content

Conflict-marker diagnostic falsely rejects heredoc content #1434

Description

@fglock

Summary

PerlOnJava incorrectly reports a version-control conflict marker when a Perl heredoc contains a legitimate run of = characters. This is a parser regression that breaks Text::FormatTable v1.03.

CPAN evidence

  • CPAN run: 20260918-141920-96054
  • Distribution: Text::FormatTable v1.03
  • System Perl: PASS — 5 tests
  • PerlOnJava: FAIL during compilation
  • Both JVM and interpreter backends reproduce the failure

The upstream test contains a heredoc with expected table output. One line consists of a run of equals signs:

my $shouldbe = <<'END';
 a| b     c
=================
...
END

PerlOnJava aborts before the test can run:

Version control conflict marker at test.pl line 21, near "============="

The same test passes under standard Perl.

Root cause

The conflict-marker diagnostic added by commit 2d3c36bb2355 treats the equals-sign content inside the heredoc as a CONFLICT_MARKER token. The diagnostic is intended for actual source-level merge markers such as a standalone ======= line, but it is being applied to literal heredoc content where the text must remain part of the string.

The failure is therefore independent of Text::FormatTable behavior; the module's test data happens to contain the triggering text.

Reproduction

Run the Text::FormatTable v1.03 test suite with PerlOnJava. The test.pl program fails at the heredoc line containing the table rule. A minimal equivalent reproducer is:

my $text = <<'END';
=======
END

This must compile as a string literal and must not raise a conflict-marker diagnostic. The archived CPAN run reproduces the failure on both execution backends.

Expected behavior

Conflict-marker diagnostics should not inspect or tokenize the contents of quoted strings, including heredocs. Literal sequences of seven or more <, =, or > characters inside a string must remain string data.

Actual source-level conflict markers should continue to receive the intended diagnostic when they occur in a context where Perl treats them as source rather than string content.

Requested fix

  • Restrict conflict-marker detection to valid source-level marker positions outside quoted strings and heredocs.
  • Preserve the existing diagnostics for genuine conflict markers.
  • Add a focused parser regression test covering equals-sign runs in heredocs and quoted strings.
  • Rerun Text::FormatTable v1.03 and the existing conflict-marker diagnostic tests on both JVM and interpreter backends.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cpan-portCPAN compatibility ports and providersarea:parserParsing compilation AST and eval behaviorbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions