[colorer/Colorer-schemes] master: shell-posix: fix heredoc with '<<-' operator (#203) (0e84949)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
Apr 19, 2026, 10:01:01 AMApr 19
to farco...@googlegroups.com
Repository : https://github.com/colorer/Colorer-schemes
On branch : master
Link : https://github.com/colorer/Colorer-schemes/commit/0e84949a3c40d8d993733b3b64b3e51a370f6215

>---------------------------------------------------------------

commit 0e84949a3c40d8d993733b3b64b3e51a370f6215
Author: Kostiantyn Kushnir <chp...@gmail.com>
Date: Sun Apr 19 16:52:29 2026 +0300

shell-posix: fix heredoc with '<<-' operator (#203)

* shell-posix: fix heredoc with '<<-' operator

Closes: chpock/ck.colorer-schemes#23

* Update changelog


>---------------------------------------------------------------

0e84949a3c40d8d993733b3b64b3e51a370f6215
CHANGELOG.md | 1 +
base/hrc/scripts/shell-posix.hrc | 18 +++++++++++++++---
2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3133dbc..a35d10d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -59,6 +59,7 @@
- [cmake] fix escaping strings
- [cpp] functions outliner list cleanup
- [markdown] improve HTML handling (inline tags and CommonMark blocks)
+- [shell-posix] fix heredoc with '<<-' operator

### Added
- New package type of base - all packed. Hrc and hrd files in one archive. Directory 'auto' not in archive.
diff --git a/base/hrc/scripts/shell-posix.hrc b/base/hrc/scripts/shell-posix.hrc
index b14b7b4..bc584b2 100644
--- a/base/hrc/scripts/shell-posix.hrc
+++ b/base/hrc/scripts/shell-posix.hrc
@@ -303,17 +303,29 @@
<scheme name="redirections_end_caught">
<inherit scheme="redirections_start"/>
<!-- heredoc in form [n]<<'word' -->
- <block start="/(?{HeredocDescriptor}\d*)(?{HeredocOperator}&lt;&lt;-?)\s*([&quot;&apos;])(?{HeredocAnchor}[\w\d_-]+)(\1)/"
+ <block start="/(?{HeredocDescriptor}\d*)(?{HeredocOperator}&lt;&lt;-)\s*([&quot;&apos;])(?{HeredocAnchor}[\w\d_-]+)(\1)/"
+ end="/^\t*((\y{HeredocAnchor}))$/" scheme="heredoc_quoted"
+ region01="StringEdge" region02="StringEdge" region11="HeredocAnchor"
+ region00="PairStart" region12="PairEnd"/>
+ <block start="/(?{HeredocDescriptor}\d*)(?{HeredocOperator}&lt;&lt;)\s*([&quot;&apos;])(?{HeredocAnchor}[\w\d_-]+)(\1)/"
end="/^(\y{HeredocAnchor})$/" scheme="heredoc_quoted"
region01="StringEdge" region02="StringEdge" region11="HeredocAnchor"
region00="PairStart" region10="PairEnd"/>
<!-- heredoc in form [n]<<\word -->
- <block start="/(?{HeredocDescriptor}\d*)(?{HeredocOperator}&lt;&lt;-?)\s*(\\)(?{HeredocAnchor}[\w\d_-]+)/"
+ <block start="/(?{HeredocDescriptor}\d*)(?{HeredocOperator}&lt;&lt;-)\s*(\\)(?{HeredocAnchor}[\w\d_-]+)/"
+ end="/^\t*((\y{HeredocAnchor}))$/" scheme="heredoc_quoted"
+ region01="StringEdge" region11="HeredocAnchor"
+ region00="PairStart" region12="PairEnd"/>
+ <block start="/(?{HeredocDescriptor}\d*)(?{HeredocOperator}&lt;&lt;)\s*(\\)(?{HeredocAnchor}[\w\d_-]+)/"
end="/^(\y{HeredocAnchor})$/" scheme="heredoc_quoted"
region01="StringEdge" region11="HeredocAnchor"
region00="PairStart" region10="PairEnd"/>
<!-- heredoc in form [n]<<word -->
- <block start="/(?{HeredocDescriptor}\d*)(?{HeredocOperator}&lt;&lt;-?)\s*(?{HeredocAnchor}[\w\d_-]+)/"
+ <block start="/(?{HeredocDescriptor}\d*)(?{HeredocOperator}&lt;&lt;-)\s*(?{HeredocAnchor}[\w\d_-]+)/"
+ end="/^\t*((\y{HeredocAnchor}))$/" scheme="heredoc"
+ region11="HeredocAnchor"
+ region00="PairStart" region12="PairEnd"/>
+ <block start="/(?{HeredocDescriptor}\d*)(?{HeredocOperator}&lt;&lt;)\s*(?{HeredocAnchor}[\w\d_-]+)/"
end="/^(\y{HeredocAnchor})$/" scheme="heredoc"
region11="HeredocAnchor"
region00="PairStart" region10="PairEnd"/>


Reply all
Reply to author
Forward
0 new messages