D15207: precompute attribute format for context & rules

2018-09-01 Thread Christoph Cullmann
cullmann added a comment.


  :=)
  
  The second lookup round over all included rules in the context did really 
hide some things.
  
  Now we properly keep track which context is needed to be used for the lookup.
  
  2321fc443483fb5669f9092980c7ab25bf78778d 

  7af02d6b955ef60ac7e9666b2694c461500d52bc 


REPOSITORY
  R216 Syntax Highlighting

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

To: cullmann, vkrause, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D15207: precompute attribute format for context & rules

2018-09-01 Thread Christoph Cullmann
This revision was automatically updated to reflect the committed changes.
Closed by commit R216:2321fc443483: try to fix unit tests (authored by 
cullmann).

CHANGED PRIOR TO COMMIT
  https://phabricator.kde.org/D15207?vs=40827=40830#toc

REPOSITORY
  R216 Syntax Highlighting

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D15207?vs=40827=40830

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

AFFECTED FILES
  autotests/html/csharp.cs.html
  autotests/html/highlight.cmake.html
  autotests/html/highlight.cpp.html
  autotests/html/highlight.css.html
  autotests/html/highlight.dox.html
  autotests/html/highlight.hs.html
  autotests/html/highlight.js.html
  autotests/html/highlight.lhs.html
  autotests/html/highlight.lua.html
  autotests/html/highlight.qml.html
  autotests/html/highlight.tex.html
  autotests/html/highlight.y.html
  autotests/html/modelines.py.html
  autotests/html/test.Rd.html
  autotests/html/test.coffee.html
  autotests/html/test.htm.html
  autotests/html/test.js.html
  autotests/html/test.py.html
  autotests/html/test.qml.html
  autotests/html/test.te.html
  autotests/reference/csharp.cs.ref
  autotests/reference/highlight.cmake.ref
  autotests/reference/highlight.cpp.ref
  autotests/reference/highlight.css.ref
  autotests/reference/highlight.dox.ref
  autotests/reference/highlight.hs.ref
  autotests/reference/highlight.js.ref
  autotests/reference/highlight.lhs.ref
  autotests/reference/highlight.lua.ref
  autotests/reference/highlight.qml.ref
  autotests/reference/highlight.tex.ref
  autotests/reference/highlight.y.ref
  autotests/reference/modelines.py.ref
  autotests/reference/review128925-1.css.ref
  autotests/reference/review128925-2.css.ref
  autotests/reference/test.Rd.ref
  autotests/reference/test.coffee.ref
  autotests/reference/test.htm.ref
  autotests/reference/test.js.ref
  autotests/reference/test.py.ref
  autotests/reference/test.qml.ref
  autotests/reference/test.te.ref
  src/lib/context.cpp
  src/lib/context_p.h
  src/lib/rule.cpp

To: cullmann, vkrause, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D15207: precompute attribute format for context & rules

2018-09-01 Thread Christoph Cullmann
cullmann reopened this revision.
cullmann added a comment.
This revision is now accepted and ready to land.


  Hmm, tests are unstable :/
  I did run them here now X times, they are stable. Perhaps depending on which 
highlightings got parsed in which order.
  Why should then the id's be equal for different definitions?
  
  e.g.
  
  QDEBUG : TestHighlighterTest::testHighlight(test.py) Using syntax "Python"
  
  - "/home/jenkins/workspace/Frameworks syntax-highlighting kf5-qt5 
SUSEQt5.9/autotests/reference/test.py.ref"  2018-09-01 16:10:03.327043830 +
  
  +++ "/home/jenkins/workspace/Frameworks syntax-highlighting kf5-qt5 
SUSEQt5.9/build/autotests/output/test.py.ref" 2018-09-01 16:13:08.885670252 
+
  @@ -1,6 +1,6 @@
  -# comment with ALERT
  +# comment with ALERT
   
  -''' multiline
  +''' multiline
   comment
   ###
   '''

REPOSITORY
  R216 Syntax Highlighting

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

To: cullmann, vkrause, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D15207: precompute attribute format for context & rules

2018-09-01 Thread Christoph Cullmann
This revision was automatically updated to reflect the committed changes.
Closed by commit R216:91d29a45389e: precompute attribute format for context 
 rules (authored by cullmann).

REPOSITORY
  R216 Syntax Highlighting

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D15207?vs=40826=40827

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

AFFECTED FILES
  autotests/html/csharp.cs.html
  autotests/html/highlight.cmake.html
  autotests/html/highlight.cpp.html
  autotests/html/highlight.css.html
  autotests/html/highlight.dox.html
  autotests/html/highlight.hs.html
  autotests/html/highlight.js.html
  autotests/html/highlight.lhs.html
  autotests/html/highlight.lua.html
  autotests/html/highlight.qml.html
  autotests/html/highlight.tex.html
  autotests/html/highlight.y.html
  autotests/html/modelines.py.html
  autotests/html/test.Rd.html
  autotests/html/test.coffee.html
  autotests/html/test.htm.html
  autotests/html/test.js.html
  autotests/html/test.py.html
  autotests/html/test.qml.html
  autotests/html/test.te.html
  autotests/reference/csharp.cs.ref
  autotests/reference/highlight.cmake.ref
  autotests/reference/highlight.cpp.ref
  autotests/reference/highlight.css.ref
  autotests/reference/highlight.dox.ref
  autotests/reference/highlight.gdb.ref
  autotests/reference/highlight.hs.ref
  autotests/reference/highlight.js.ref
  autotests/reference/highlight.lhs.ref
  autotests/reference/highlight.lua.ref
  autotests/reference/highlight.qml.ref
  autotests/reference/highlight.tex.ref
  autotests/reference/highlight.y.ref
  autotests/reference/modelines.py.ref
  autotests/reference/review128925-1.css.ref
  autotests/reference/review128925-2.css.ref
  autotests/reference/test.Rd.ref
  autotests/reference/test.coffee.ref
  autotests/reference/test.htm.ref
  autotests/reference/test.js.ref
  autotests/reference/test.jsx.ref
  autotests/reference/test.py.ref
  autotests/reference/test.qml.ref
  autotests/reference/test.te.ref
  src/lib/CMakeLists.txt
  src/lib/abstracthighlighter.cpp
  src/lib/context.cpp
  src/lib/context_p.h
  src/lib/definition.cpp
  src/lib/matchresult.cpp
  src/lib/matchresult_p.h
  src/lib/repository.cpp
  src/lib/rule.cpp
  src/lib/rule_p.h

To: cullmann, vkrause, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D15207: precompute attribute format for context & rules

2018-09-01 Thread Volker Krause
vkrause accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  master

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

To: cullmann, vkrause, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D15207: precompute attribute format for context & rules

2018-09-01 Thread Christoph Cullmann
cullmann added a comment.


  I inlined the MatchResult, it is used the whole time and given it is purely 
internal, one doesn't need to waste cycles for having calls to get the two ints 
and the reference to the stringlist.
  The implicit constructor now doesn't play around with the stringlist either.

REPOSITORY
  R216 Syntax Highlighting

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

To: cullmann, vkrause, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D15207: precompute attribute format for context & rules

2018-09-01 Thread Christoph Cullmann
cullmann updated this revision to Diff 40826.
cullmann added a comment.


  inline MatchResult, very often used, no need to waste time for calls
  
  fix scoping in Repository::definitionForMimeType

REPOSITORY
  R216 Syntax Highlighting

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D15207?vs=40825=40826

BRANCH
  master

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

AFFECTED FILES
  autotests/html/csharp.cs.html
  autotests/html/highlight.cmake.html
  autotests/html/highlight.cpp.html
  autotests/html/highlight.css.html
  autotests/html/highlight.dox.html
  autotests/html/highlight.hs.html
  autotests/html/highlight.js.html
  autotests/html/highlight.lhs.html
  autotests/html/highlight.lua.html
  autotests/html/highlight.qml.html
  autotests/html/highlight.tex.html
  autotests/html/highlight.y.html
  autotests/html/modelines.py.html
  autotests/html/test.Rd.html
  autotests/html/test.coffee.html
  autotests/html/test.htm.html
  autotests/html/test.js.html
  autotests/html/test.py.html
  autotests/html/test.qml.html
  autotests/html/test.te.html
  autotests/reference/csharp.cs.ref
  autotests/reference/highlight.cmake.ref
  autotests/reference/highlight.cpp.ref
  autotests/reference/highlight.css.ref
  autotests/reference/highlight.dox.ref
  autotests/reference/highlight.gdb.ref
  autotests/reference/highlight.hs.ref
  autotests/reference/highlight.js.ref
  autotests/reference/highlight.lhs.ref
  autotests/reference/highlight.lua.ref
  autotests/reference/highlight.qml.ref
  autotests/reference/highlight.tex.ref
  autotests/reference/highlight.y.ref
  autotests/reference/modelines.py.ref
  autotests/reference/review128925-1.css.ref
  autotests/reference/review128925-2.css.ref
  autotests/reference/test.Rd.ref
  autotests/reference/test.coffee.ref
  autotests/reference/test.htm.ref
  autotests/reference/test.js.ref
  autotests/reference/test.jsx.ref
  autotests/reference/test.py.ref
  autotests/reference/test.qml.ref
  autotests/reference/test.te.ref
  src/lib/CMakeLists.txt
  src/lib/abstracthighlighter.cpp
  src/lib/context.cpp
  src/lib/context_p.h
  src/lib/definition.cpp
  src/lib/matchresult.cpp
  src/lib/matchresult_p.h
  src/lib/repository.cpp
  src/lib/rule.cpp
  src/lib/rule_p.h

To: cullmann, vkrause, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D15207: precompute attribute format for context & rules

2018-09-01 Thread Christoph Cullmann
cullmann created this revision.
cullmann added reviewers: vkrause, dhaumann.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
cullmann requested review of this revision.

REVISION SUMMARY
  avoid costly lookup, e.g. 3% of runtime of highlighting
  
  simplifies the highlightLine stuff, as we only need to keep track of format 
changes,
  not lookup contexts in addition
  
  fixes that we don't see that formats change if name is equal in different
  definitions
  
  accessors are inline, the classes are internal anyways

TEST PLAN
  make && make test
  
  updated references, now we properly applyFormat if we walk from one into a 
other
  definition with same name formats

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  master

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

AFFECTED FILES
  autotests/html/csharp.cs.html
  autotests/html/highlight.cmake.html
  autotests/html/highlight.cpp.html
  autotests/html/highlight.css.html
  autotests/html/highlight.dox.html
  autotests/html/highlight.hs.html
  autotests/html/highlight.js.html
  autotests/html/highlight.lhs.html
  autotests/html/highlight.lua.html
  autotests/html/highlight.qml.html
  autotests/html/highlight.tex.html
  autotests/html/highlight.y.html
  autotests/html/modelines.py.html
  autotests/html/test.Rd.html
  autotests/html/test.coffee.html
  autotests/html/test.htm.html
  autotests/html/test.js.html
  autotests/html/test.py.html
  autotests/html/test.qml.html
  autotests/html/test.te.html
  autotests/reference/csharp.cs.ref
  autotests/reference/highlight.cmake.ref
  autotests/reference/highlight.cpp.ref
  autotests/reference/highlight.css.ref
  autotests/reference/highlight.dox.ref
  autotests/reference/highlight.gdb.ref
  autotests/reference/highlight.hs.ref
  autotests/reference/highlight.js.ref
  autotests/reference/highlight.lhs.ref
  autotests/reference/highlight.lua.ref
  autotests/reference/highlight.qml.ref
  autotests/reference/highlight.tex.ref
  autotests/reference/highlight.y.ref
  autotests/reference/modelines.py.ref
  autotests/reference/review128925-1.css.ref
  autotests/reference/review128925-2.css.ref
  autotests/reference/test.Rd.ref
  autotests/reference/test.coffee.ref
  autotests/reference/test.htm.ref
  autotests/reference/test.js.ref
  autotests/reference/test.jsx.ref
  autotests/reference/test.py.ref
  autotests/reference/test.qml.ref
  autotests/reference/test.te.ref
  src/lib/abstracthighlighter.cpp
  src/lib/context.cpp
  src/lib/context_p.h
  src/lib/definition.cpp
  src/lib/rule.cpp
  src/lib/rule_p.h

To: cullmann, vkrause, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, 
demsking, cullmann, sars, dhaumann