Bug 476879

Summary: Syntax highlighting fails to recognize Scheme function definition
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: ceving
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph, jlp, walter.von.entferndt
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: screenshot showing wrong highlighting

Description ceving 2023-11-12 12:38:21 UTC
Created attachment 163075 [details]
screenshot showing wrong highlighting

SUMMARY
Scheme provides two ways to define functions. This works as expected:

    (define function-name (lambda () #t))

But this does not work:

    (define (function-name) #f)

STEPS TO REPRODUCE
1. Open a file with the above code
2. Save it with the extension ".scm"
3. Check if the identifier "function-name" gets recognized as an identifier.

OBSERVED RESULT
In the first expression the function name gets rendered purple.
But in the second expression the function name is just black.

EXPECTED RESULT
Both occurrences of "function-name" must be rendered the same.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Debian GNU/Linux 12 (bookworm) 12 (x86_64)
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 ceving 2023-11-25 11:10:27 UTC
This affects also other projects, which use the Kate syntax definitions.

https://github.com/jgm/skylighting/issues/177
Comment 2 Bug Janitor Service 2025-05-24 22:25:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/704
Comment 3 Christoph Cullmann 2025-05-25 12:16:25 UTC
Git commit 83a6bfee5904d77bcea6b0dc708faa04c1ecb774 by Christoph Cullmann, on behalf of Jonathan Poelen.
Committed on 25/05/2025 at 12:05.
Pushed by cullmann into branch 'master'.

Scheme: highlight name of syntactical sugar for procedure as Function

M  +6    -6    autotests/html/highlight.scheme.dark.html
M  +6    -6    autotests/html/highlight.scheme.html
M  +6    -6    autotests/reference/highlight.scheme.ref
M  +139  -20   data/syntax/scheme.xml

https://invent.kde.org/frameworks/syntax-highlighting/-/commit/83a6bfee5904d77bcea6b0dc708faa04c1ecb774