Bug 400345

Summary: [PATCH] perl syntax highlighting: add labels
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: bes.internal <bes.internal>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: christoph, nibgonz
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description bes.internal 2018-10-26 15:44:19 UTC
Please support definition of perl LABEL.
Definition as LABEL: or label: and call like goto LABEL
Ref http://perldoc.perl.org/functions/goto.html

It looks like this to me.
http://internal.by/i/20181026184338.png


reverse patch over version 7:
----------------------------------
diff --git a/perl.xml b/perl.xml
index 5ecdc47..cd3d3ce 100644
--- a/perl.xml
+++ b/perl.xml
@@ -349,8 +349,6 @@
         <RegExpr attribute="Pod" context="pod" String="\=\w+(\s|$)" column="0" beginRegion="POD"/>
         <DetectSpaces />
         <DetectChar attribute="Comment" context="comment" char="#" />
-        <RegExpr attribute="Label" String="^[A-Z0-9_]+:$" />
-        <RegExpr attribute="Label small" String="^[a-z0-9]+:$" />
 
         <!-- Numeric values. Note that we have to allow underscores between two digits (thus the creepy regular expressions). -->
         <RegExpr attribute="Hex" String="\b\-?0[xX]([0-9a-fA-F]|_[0-9a-fA-F])+" context="slash_safe_escape"/>
@@ -848,8 +846,6 @@
     </contexts>
     <itemDatas>
       <itemData name="Normal Text"               defStyleNum="dsNormal" />
-      <itemData name="Label"                     defStyleNum="dsLabel" />
-      <itemData name="Label small"               defStyleNum="dsLabel small" />
       <itemData name="Keyword"                   defStyleNum="dsKeyword" />
       <itemData name="Pragma"                    defStyleNum="dsKeyword" />
       <itemData name="Function"                  defStyleNum="dsFunction" />
----------------------------------
Comment 1 Nibaldo G. 2018-10-29 05:32:06 UTC
It would be great if you could send your patch to the syntax-highlighting repository: https://phabricator.kde.org/source/syntax-highlighting/ (file: data/syntax/perl.xml)

Here is the documentation to send patches with Arcanist: https://community.kde.org/Infrastructure/Phabricator

The only problem I see in your changes, is that you use "dsLabel" and "dsLabel small" in defStyleNum, which (I understand) are not valid styles. The styles are described here: https://docs.kde.org/trunk5/en/applications/katepart/highlight.html (section: Available Default Styles).
Although the ideal is not to use hard colors, if you use background color you can write:

<itemData name="Label" defStyleNum="dsNormal" bold="1" color="#FFFFFF" selColor="#FFFFFF" backgroundColor="#FF007F" />
Comment 2 Christoph Cullmann 2019-08-24 16:10:18 UTC
Yes, provide a patch please!
Thanks.
Comment 3 Bug Janitor Service 2019-09-08 04:33:08 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Bug Janitor Service 2019-09-23 04:33:09 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!