D24378: WordDetect rule: detect delimiters at the inner edge of the string

Nibaldo González noreply at phabricator.kde.org
Thu Oct 3 07:24:54 BST 2019


nibags created this revision.
nibags added reviewers: Framework: Syntax Highlighting, dhaumann, cullmann, vkrause, jpoelen.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
nibags requested review of this revision.

REVISION SUMMARY
  In WordDetect rules, verify delimiter characters also on the right and left edges inside the string.
  
  For example:
  
    <WordDetect attribute="Keyword" String="<hello"/>
  
  In the past, this rule was equivalent to `\b<hello\b` in regular expression. Now, it's equivalent to `<hello\b`, since `<` is a delimiter character.
  
  I have checked the WordDetect rules in all definitions and and I haven't seen regressions. In the definitions `elm.xml`, `selinux-cil.xml` and `selinux-fc.xml` I replaced some WordDetect rules with StringDetect, since in this change they are equivalent.

TEST PLAN
  make test

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  fix-worddetect

REVISION DETAIL
  https://phabricator.kde.org/D24378

AFFECTED FILES
  autotests/folding/delimiters_WordDetect.delWordDetect.fold
  autotests/html/delimiters_WordDetect.delWordDetect.html
  autotests/input/delimiters_WordDetect.delWordDetect
  autotests/input/syntax/delimiters_WordDetect.xml
  autotests/reference/delimiters_WordDetect.delWordDetect.ref
  data/syntax/elm.xml
  data/syntax/selinux-cil.xml
  data/syntax/selinux-fc.xml
  src/lib/rule.cpp

To: nibags, #framework_syntax_highlighting, dhaumann, cullmann, vkrause, jpoelen
Cc: kwrite-devel, kde-frameworks-devel, LeGast00n, GB_2, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191003/664c4a2c/attachment.html>


More information about the Kde-frameworks-devel mailing list