Skip to content

Fix Bash function list broken by quoted here-document delimiter - #18545

Open
haraldrohan wants to merge 2 commits into
notepad-plus-plus:masterfrom
haraldrohan:fix_bash_functionlist_quoted_heredoc_20261024
Open

haraldrohan wants to merge 2 commits into
notepad-plus-plus:masterfrom
haraldrohan:fix_bash_functionlist_quoted_heredoc_20261024

Conversation

@haraldrohan

@haraldrohan haraldrohan commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #13849.

bash.xml only recognized here-documents with an unquoted delimiter (<<EOF). With a quoted one (<<'EOF', <<"EOF", <<\EOF), a single quote inside the here-document started a string literal that swallowed the following functions.

Fix

Allow an optional ", ' or \ before the delimiter in both here-document forms (<< and <<-). The closing quote is already consumed by the existing [^\r\n]*.

Test plan

  • New unit test bash/quoted_heredoc with the example from the issue plus <<"END", <<\END and <<-'END': fails before (1 of 5 functions listed), passes after, with LF and CRLF.
  • Full Function List test harness: all 47 tests pass.

🤖 Generated with Claude Code

The here-document part of the Bash commentExpr only accepted an unquoted
delimiter (<<EOF). With a quoted one (<<'EOF', <<"EOF", <<\EOF), the
here-document wasn't recognized, so a single quote inside it started a
string literal that swallowed the following functions.

Allow an optional quote or backslash before the delimiter, and add a
unit test covering the quoted forms.

Fix notepad-plus-plus#13849

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chcg chcg added the language-support Issues or PRs related to programming languages (also e.g. in styles, themes) label Oct 25, 2026
@MarkusBodensee

Copy link
Copy Markdown
Contributor

@haraldrohan
In unit test file, there are some places, where it states something about single quote (mostly comments etc) where instead somesthing about double quote or backslashes should be.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@haraldrohan

Copy link
Copy Markdown
Contributor Author

Thanks! I agree the wording was confusing and reworded the test file, hope that explains it better now. The bodies now also contain a lone ", which would have broken the list the same way.

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

Labels

language-support Issues or PRs related to programming languages (also e.g. in styles, themes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bash Function List fails to list functions following a HEREDOC containing a one single quote

3 participants