Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Conflict-marker diagnostic falsely rejects heredoc content

未关闭
#1,434 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
java, perl
领域
compilers

调研方向

从 commit 2d3c36bb235 引入的冲突标记诊断开始,重现最小 heredoc 案例,然后检查 CONFLICT_MARKER 附近的解析器处理。使用 Text::FormatTable v1.03 重现中的 test.pl,以及现有的冲突标记诊断测试进行检查。当 heredoc 和带引号的标记文本能够编译,而真正的源代码标记仍会在 JVM 和解释器两个后端上产生诊断时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

area:cpan-port area:parser bug

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.
主要语言
Perl
星标
64
派生
6
平均合并
5 小时 38 分钟
30 天内合并 PR
170

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。