Conflict-marker diagnostic falsely rejects heredoc content
还没有人认领这个 Issue。
评估
调研方向
从 commit 2d3c36bb235 引入的冲突标记诊断开始,重现最小 heredoc 案例,然后检查 CONFLICT_MARKER 附近的解析器处理。使用 Text::FormatTable v1.03 重现中的 test.pl,以及现有的冲突标记诊断测试进行检查。当 heredoc 和带引号的标记文本能够编译,而真正的源代码标记仍会在 JVM 和解释器两个后端上产生诊断时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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::FormatTablev1.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::FormatTablev1.03 and the existing conflict-marker diagnostic tests on both JVM and interpreter backends.
- 主要语言
- Perl
- 星标
- 64
- 派生
- 6
- 平均合并
- 5 小时 38 分钟
- 30 天内合并 PR
- 170
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fglock/PerlOnJava 的其他 Issue
-
area:cpan-port area:unicode bug
难度 2/5 1-3 小时 新手友好度 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:runtime bug
难度 4/5 3-5 天 新手友好度 45/100
fglock/PerlOnJava#1511 ·
-
area:backend area:cpan-port bug
难度 4/5 3-5 天 新手友好度 45/100
fglock/PerlOnJava#1508 · 1 条评论 ·
-
area:cpan-port area:platform enhancement
难度 5/5 一周以上 新手友好度 30/100
fglock/PerlOnJava#1507 ·
-
bug
难度 4/5 3-5 天 新手友好度 45/100
fglock/PerlOnJava#1506 ·
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
documentation Needs Triage
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
trizen/youtube-viewer#456 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
connectivity 未关闭
难度 1/5 1 小时以内 新手友好度 80/100
-
Common US ingredient names are not recognized, so about 12.4k US products miss an allergen warning 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
openfoodfacts/openfoodfacts-server#14657 · 4 条评论 ·