D7478: Escape hyphen in rest.xml regular expressions

Heiko Becker noreply at phabricator.kde.org
Wed Aug 23 10:35:10 UTC 2017


heikobecker created this revision.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.

REVISION SUMMARY
  The unescaped hyphen caused a build failure with pcre2-10.30 due to a broken
  regex: 'syntax-highlighting/data/syntax/rest.xml" line 27 broken regex:
  "^\\s*\\.\\. [w-_\\.]+::(\\s|$)" problem: "range out of order in character
  class" at offset 12'.
  
  The pcre2pattern documentation says this:
  
  "Perl treats a hyphen as a literal if it appears before or after a POSIX class
  (see below) or before or after a character type escape such as as \d or \H.
  However, unless the hyphen is the last character in the class, Perl outputs a
  warning in its warning mode, as this is most likely a user error. As PCRE2 has
  no facility for warning, an error is given in these cases."

TEST PLAN
  cmake && make && make test works fine pcre2-10.30, quick look at
  http://docutils.sourceforge.net/FAQ.txt in kate seems fine.

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  master

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

AFFECTED FILES
  CMakeLists.txt
  data/syntax/rest.xml

To: heikobecker, #framework_syntax_hightlighting, kfunk
Cc: #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170823/f8f042dd/attachment.html>


More information about the Kde-frameworks-devel mailing list