Review Request 120442: Fix comments in Haskell highlighting

Dominik Haumann dhaumann at kde.org
Wed Oct 1 20:02:42 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120442/#review67784
-----------------------------------------------------------


This highlighting file extensively uses the RegExpr rules. While this is of course ok, it is often not needed, see opened issue below.

For instance, also these lines
    <RegExpr attribute="C2HS Directive"  context="c2hs directive" String="{#"/>
    <RegExpr attribute="C2HS Directive"  context="c2hs include" String="#"/>
can be turned into
    <StringDetect attribute="C2HS Directive"  context="c2hs directive" String="{#" />
    <DetectChar attribute="C2HS Directive"  context="c2hs include" char="#" />


src/syntax/data/haskell.xml
<https://git.reviewboard.kde.org/r/120442/#comment47202>

    context="#stay" is missing :-)
    
    Further, could you use a StringDetect rule instead? It's much faster than a RegExpr, see:
    https://docs.kde.org/stable/en/applications/kate/kate-highlight-rules-detailled.html
    
    Like this:
    <StringDetect attribute="Comment" context="#stay" String="{--}" />


- Dominik Haumann


On Sept. 30, 2014, 7:14 p.m., Bastian Holst wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120442/
> -----------------------------------------------------------
> 
> (Updated Sept. 30, 2014, 7:14 p.m.)
> 
> 
> Review request for KDE Frameworks and Christoph Cullmann.
> 
> 
> Repository: ktexteditor
> 
> 
> Description
> -------
> 
> A comment like {--} resultet in staying in the Comments section until
> reaching the next -}
> 
> 
> Diffs
> -----
> 
>   src/syntax/data/haskell.xml f0e7f8f955ea9cd56795add8de03c6627313301a 
> 
> Diff: https://git.reviewboard.kde.org/r/120442/diff/
> 
> 
> Testing
> -------
> 
> Manual testing with several Haskell files in my day-time job.
> 
> 
> Thanks,
> 
> Bastian Holst
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20141001/058c17df/attachment.html>


More information about the Kde-frameworks-devel mailing list