Bug 470920 - Makefile syntax highlighting doesn't handle line-breaks for multiple targets
Summary: Makefile syntax highlighting doesn't handle line-breaks for multiple targets
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-12 01:42 UTC by samcaspar
Modified: 2023-07-12 21:16 UTC (History)
3 users (show)

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


Attachments
screenshot example (7.05 KB, image/png)
2023-06-12 01:42 UTC, samcaspar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description samcaspar 2023-06-12 01:42:27 UTC
Created attachment 159606 [details]
screenshot example

Syntax highlighting handles line breaks in dependencies correctly, e.g.:

```
target1 target2 &: \
		dep1 \
		dep2 \
		dep3
```

will correctly highlight all of the deps as (for me) blue, the line breaks as purple, and the targets as yellow.

However if I have multiple targets split over multiple lines:

```
target1 \
target2 \
target3 &: \
		dep1 \
		dep2 \
		dep3
```

Then the first two lines of targets area not highlighted.

Apologies if pedantic.
Comment 1 Bug Janitor Service 2023-07-11 01:53:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/500
Comment 2 Christoph Cullmann 2023-07-12 21:16:14 UTC
Git commit ae9a777a68c99f77df17c172a370c199f43512cc by Christoph Cullmann, on behalf of Jonathan Poelen.
Committed on 12/07/2023 at 21:16.
Pushed by cullmann into branch 'master'.

Makefile: add multi-line target, target variable value, target separator and...

Makefile: add multi-line target, target variable value, target separator and keyword ; fix define and escaped rule

- multi-line target

```mk
target1 \
target2: ....
```

- target-specific variable value

```mk
prog: private EXTRA_CFLAGS = -L/usr/local/lib
prog: CFLAGS = -g
 #    ^ variable
 #            ^ value
```

- target separator

```mk
prog:
prog::
prog&:
prog&::
 #  ^ TargetSeparator style
```

- fix escaped rule

```mk
prog:
	echo bla \
   bla
 #^ no tab is ok
```

M  +23   -1    autotests/folding/Makefile.fold
M  +32   -10   autotests/html/Makefile.dark.html
M  +32   -10   autotests/html/Makefile.html
M  +23   -1    autotests/input/Makefile
M  +32   -10   autotests/reference/Makefile.ref
M  +2    -2    data/syntax/latex.xml
M  +101  -28   data/syntax/makefile.xml

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