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

Authored by cullmann on Mar 12 2020, 10:59 PM.

Details

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

Diff Detail

Repository
R216 Syntax Highlighting
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 23637
Build 23655: arc lint + arc unit
cullmann created this revision.Mar 12 2020, 10:59 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptMar 12 2020, 10:59 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
cullmann requested review of this revision.Mar 12 2020, 10:59 PM
cullmann updated this revision to Diff 77526.Mar 12 2020, 11:00 PM

remove useless output of stray azOffset var

dhaumann accepted this revision.Mar 13 2020, 4:46 PM

I guess in a followup commit the reported issues will be fixed? :-)

This revision is now accepted and ready to land.Mar 13 2020, 4:46 PM

Yes, I will fix the issues and then commit this as one thingy.
Thanks for taking a look :=)
My colleague was very unhappy with the VHDL performance :P
The highlighting shouldn't take as long as a hardware simulator.

This revision was automatically updated to reflect the committed changes.

Better, but VHDL hl is still very slow, need to take a deeper look into it :/