Bug 473471 - Syntax highlighting broke after the `${!}` expansion for Bash scripts
Summary: Syntax highlighting broke after the `${!}` expansion for Bash scripts
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (show other bugs)
Version: 5.92.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-17 10:27 UTC by 林博仁(Buo-ren, Lin)
Modified: 2023-08-21 20:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Example script for bug reroduction (142 bytes, application/x-shellscript)
2023-08-17 10:27 UTC, 林博仁(Buo-ren, Lin)
Details
Bug reproduction screenshot (52.61 KB, image/png)
2023-08-17 10:56 UTC, 林博仁(Buo-ren, Lin)
Details
Example script for bug reroduction (191 bytes, application/x-shellscript)
2023-08-17 10:58 UTC, 林博仁(Buo-ren, Lin)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 林博仁(Buo-ren, Lin) 2023-08-17 10:27:10 UTC
Created attachment 161018 [details]
Example script for bug reroduction

SUMMARY

The exclamation mark (!) is a special parameter that will "expands to the process ID of the job most recently placed into the background, whether executed as an asynchronous command or using the bg builtin" according to the Bash manual, however currently when encountering the `"${!}"` (opening double-quote, dollar sign, opening curly braces, exclamation mark, closing curly braces, closing double-quote) character sequence all text are highlight as red until the next occurrence of `"${!}"`.

Expansion without the curly braces pair,(`$!`), however, does not reproduce such problem.

STEPS TO REPRODUCE
1. Download attached reproducing script
2. Open the script with Kate, etc.
3. Profit.

OBSERVED RESULT

Text between two `"${!}"`s is highlighted red.

EXPECTED RESULT

Text between two `"${!}"`s shouldn't be highlighted red.

SOFTWARE/OS VERSIONS
Linux: Ubuntu 22.04LTS
KDE Frameworks Version: 5.92.0 (also reproduced in 5.105.0 snap)
Qt Version: 5.15.3 (also reproduced in 5.105.9 snap)

ADDITIONAL INFORMATION

Also reproduced with the definition file of commit ca42b1ed.
Comment 1 林博仁(Buo-ren, Lin) 2023-08-17 10:30:04 UTC
s/Qt Version: 5.15.3 (also reproduced in 5.105.9 snap)/Qt Version: 5.15.3 (also reproduced in 5.15.9 snap)/g
Comment 2 林博仁(Buo-ren, Lin) 2023-08-17 10:56:25 UTC
Created attachment 161021 [details]
Bug reproduction screenshot
Comment 3 林博仁(Buo-ren, Lin) 2023-08-17 10:58:40 UTC
Created attachment 161022 [details]
Example script for bug reroduction
Comment 4 Bug Janitor Service 2023-08-20 20:52:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/527
Comment 5 Jonathan Poelen 2023-08-21 20:24:26 UTC
Git commit 18ee15c2910f80d70fe89b1f068922d8a4fcbf97 by Jonathan Poelen.
Committed on 20/08/2023 at 22:48.
Pushed by cullmann into branch 'master'.

Bash: fix ${!}

M  +1    -1    autotests/folding/highlight.sh.fold
M  +1    -1    autotests/html/highlight.sh.dark.html
M  +1    -1    autotests/html/highlight.sh.html
M  +1    -1    autotests/input/highlight.sh
M  +1    -1    autotests/reference/highlight.sh.ref
M  +3    -1    data/syntax/bash.xml

https://invent.kde.org/frameworks/syntax-highlighting/-/commit/18ee15c2910f80d70fe89b1f068922d8a4fcbf97