Skip to content

Commit

Permalink
Merge branch 'chpock-fix-shell'
Browse files Browse the repository at this point in the history
  • Loading branch information
ctapmex committed Apr 30, 2024
2 parents eca4ba7 + b427030 commit 938c91a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions hrc/hrc/scripts/shell-bash.hrc
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@
<virtual scheme="shell-posix:variable_names" subst-scheme="variable_names"/>
<virtual scheme="shell-posix:strings" subst-scheme="strings"/>
<virtual scheme="shell-posix:redirections_start" subst-scheme="redirections_start"/>
<virtual scheme="shell-posix:script_words" subst-scheme="script_words"/>
</inherit>
</scheme>

Expand Down
14 changes: 12 additions & 2 deletions hrc/hrc/scripts/shell-posix.hrc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@

<scheme name="script">
<regexp match="/\s+/"/>
<inherit scheme="escape_newline"/>
<inherit scheme="comments"/>
<inherit scheme="operators"/>
<block start="/!\s*/" end="/\M%cmdbreak;/" scheme="script_control" region00="CommandReserved"/>
Expand Down Expand Up @@ -423,11 +424,15 @@
<block start="/(^|(\s|%wrdbreak;)?#1)\#/" end="/$/" scheme="def:Comment" region="Comment"/>
</scheme>

<scheme name="escapes">
<scheme name="escape_newline">
<!-- spaces between backslash and EOL are usually unexpected -->
<block start="/\\\s+$/" end="/$/" scheme="def:empty" region="Error"/>
<!-- escape new line -->
<block start="/\\$/" end="/^/" scheme="def:empty"/>
</scheme>

<scheme name="escapes">
<inherit scheme="escape_newline"/>
<!-- ignore other escaped char -->
<regexp match="/\\./"/>
</scheme>
Expand Down Expand Up @@ -529,13 +534,18 @@
region="Error" region11="SymbolStrong"/>
</scheme>

<scheme name="case_pattern">
<inherit scheme="comments"/>
<inherit scheme="parameter_expansion"/>
</scheme>

<scheme name="case">
<!-- case ... in -->
<block start="/(case)\m/" end="/\s+(\Min)\s*/" scheme="script_words"
region01="CommandReserved" region11="CommandReserved"/>
<!-- each pattern -->
<block start="/(in|;;)(\s*esac)?!\m/" end="/\M(\)(\s*|$)|esac)/"
scheme="parameter_expansion" region="String"/>
scheme="case_pattern" region="String"/>
<!-- each body -->
<block start="/((\)))(\s*|$)/" end="/\M((;;|esac))/" scheme="script"
region01="PairStart" region12="PairEnd"
Expand Down

0 comments on commit 938c91a

Please sign in to comment.