Bug 466015 - Makefile syntax highlighting broken by semicolon (;) or hash mark (#) and by single quote in double quotes ("'")
Summary: Makefile syntax highlighting broken by semicolon (;) or hash mark (#) and by ...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: 5.98.0
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-18 17:38 UTC by kdebugs
Modified: 2023-03-05 19:08 UTC (History)
1 user (show)

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


Attachments
a Makefile demonstrating all three issues (394 bytes, text/plain)
2023-02-18 17:38 UTC, kdebugs
Details
screenshot of attachment 156449 loaded in kate (34.46 KB, image/png)
2023-02-18 17:39 UTC, kdebugs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kdebugs 2023-02-18 17:38:44 UTC
Created attachment 156449 [details]
a Makefile demonstrating all three issues

SUMMARY
Three cases of broken syntax highlighting, one of which involves broken parenthesis matching.

STEPS TO REPRODUCE
Load attached demonstration file in kate.

OBSERVED RESULT
See screenshot.

EXPECTED RESULT
case 1: semicolon and remainder of the line should be red
case 2: hash mark and remainder of the line should be gray
case 3: closing parenthesis on line 12 should match opening parenthesis that precedes it

SOFTWARE/OS VERSIONS
observed on Kubuntu 22.10
KDE Frameworks Version: 5.98.0
Comment 1 kdebugs 2023-02-18 17:39:43 UTC
Created attachment 156451 [details]
screenshot of attachment 156449 [details] loaded in kate
Comment 2 Bug Janitor Service 2023-03-05 18:42:14 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/462
Comment 3 Christoph Cullmann 2023-03-05 19:08:14 UTC
Git commit a9a759a85a5d4247c10329b1f9a4513a5ff0bcb7 by Christoph Cullmann, on behalf of Jonathan Poelen.
Committed on 05/03/2023 at 19:08.
Pushed by cullmann into branch 'master'.

Makefile: fix variable declaration, comment and semicolon in value and...

Makefile: fix variable declaration, comment and semicolon in value and rule/command semicolon separator

- Add override keyword
- Add :::= and != assignment operators
- Fix variable name
A variable name may be any sequence of characters not containing ‘:’, ‘#’, ‘=’, or whitespace.
```
???=value
^^ variable
  ^^ operator
```
- Fix comment in value
```mk
var=value#comment
var=value\#nocomment
```
- Fix semicolon in value (not a special character)
- Add one-line rule
```mk
target: file1 ; cmd ...
target: file1
	cmd ...
```
- Fix quote in some contexts
```mk
$(info "'")
```

M  +34   -0    autotests/folding/Makefile.fold
M  +46   -12   autotests/html/Makefile.dark.html
M  +46   -12   autotests/html/Makefile.html
M  +34   -0    autotests/input/Makefile
M  +46   -12   autotests/reference/Makefile.ref
M  +31   -4    data/syntax/makefile.xml

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