D28015: extend indexer to detect dynamic=true regexes that have no place holders to adapt

Christoph Cullmann noreply at phabricator.kde.org
Thu Mar 12 22:59:24 GMT 2020


cullmann created this revision.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
cullmann requested review of this revision.

REVISION SUMMARY
  see bug 418778
  
  VHDL highlighting is very slow as close to all regexes are marked as dynamic
  but most have no place holders used at all
  now the checker detects that
  
  if nobody objects to the logic of this check (I might be confused about other side-effects of dynamic),
  then I will adapt the below faults and adjust this request

TEST PLAN
  make && make test
  
  >
  =
  
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/doxygenlua.xml" line 246 broken regex: "--\\[(=*)\\[" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/latex.xml" line 405 broken regex: "(.)" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/latex.xml" line 418 broken regex: "(.)" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/lua.xml" line 472 broken regex: "\\[(=*)\\[" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/metafont.xml" line 917 broken regex: "(.)" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/sass.xml" line 140 broken regex: "(\\s+)(?=/[*/])" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/sass.xml" line 141 broken regex: "()/[*/]" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/sql-postgresql.xml" line 1013 broken regex: "\\$([^\\$\\n\\r]*)\\$" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/sql-postgresql.xml" line 1023 broken regex: "\\$([^\\$\\n\\r]*)\\$" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 222 broken regex: "(\\b)architecture\\s+(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 226 broken regex: "(\\b)package\\s+(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s+is\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 228 broken regex: "(\\b)package\\s+body\\s+(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s+is\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 231 broken regex: "(\\b)configuration\\s+(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 272 broken regex: "(\\b)function\\s+(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 287 broken regex: "(\\b)end(\\s+function)?\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 300 broken regex: "(\\b)architecture\\s+(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s+of\\s+(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s+is" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 304 broken regex: "(\\b)end(\\s+architecture)?(\\s+\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s*;" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 337 broken regex: "(\\b)end(\\s+function)?\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 349 broken regex: "(\\b)(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b\\s*:\\s*)(if|for).*\\s+generate\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 351 broken regex: "(\\b)(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b\\s*:\\s*)?process\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 353 broken regex: "(\\b)(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s*:\\s*((entity\\s+)?(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)(\\.\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)?)" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 388 broken regex: "(\\b)end\\s+process(\\s+\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)?" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 404 broken regex: "(\\b)((\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s*:\\s*)?((for|while)\\s+.+\\s+)loop\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 495 broken regex: "(\\b)when(\\s+\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)?\\b" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 536 broken regex: "(\\b)end(\\s+(entity|component))?(\\s+\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)?\\s*;" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 547 broken regex: "(\\b)configuration\\s+(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s+of\\s+(\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s+is" problem: dynamic=true but no %\d+ placeholder -1
  "/home/cullmann/projects/kde/src/syntax-highlighting/data/syntax/vhdl.xml" line 551 broken regex: "(\\b)end(\\s+configuration)?(\\s+\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s*;" problem: dynamic=true but no %\d+ placeholder -1

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  master

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

AFFECTED FILES
  src/indexer/katehighlightingindexer.cpp

To: cullmann
Cc: kwrite-devel, kde-frameworks-devel, rrosch, LeGast00n, cblack, GB_2, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20200312/96aa8028/attachment-0001.html>


More information about the KWrite-Devel mailing list