<table><tr><td style="">nibags created this revision.<br />Restricted Application added a project: Frameworks.<br />Restricted Application added a subscriber: Frameworks.<br />nibags requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D11543">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Some suggested optimizations of <a href="https://phabricator.kde.org/D10621" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D10621</a>.</p>
<p><strong>Note:</strong></p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><keywords additionalDeliminator="@" weakDeliminator=";" /></pre></div>
<p>Using KDE Frameworks 5.44, the above is only applied to the 'keywords' rules. <br />
However, when you run <tt style="background: #ebebeb; font-size: 13px;">./bin/testhighlighter_test</tt>,<tt style="background: #ebebeb; font-size: 13px;">./bin/folding_test</tt> & <tt style="background: #ebebeb; font-size: 13px;">./bin/htmlhighlighter_test</tt>, it also applies to the delimiters of the 'WordDetect' rules. <br />
This generates an error when I run testing binaries on the <tt style="background: #ebebeb; font-size: 13px;">test.sql_oracle</tt> file, in the last line <tt style="background: #ebebeb; font-size: 13px;">end; </tt> (<tt style="background: #ebebeb; font-size: 13px;"><RegExpr String="\bend\b" ../></tt> is changed to WordDetect and ';' is not delimiter). The test files with the problem are included.</p>
<p>The only files where RegExpr is changed by WordDetect are <tt style="background: #ebebeb; font-size: 13px;">sql*.xml</tt> and <tt style="background: #ebebeb; font-size: 13px;">rhtml.xml</tt>. I do not know if it will be necessary to undo these changes or it is just a problem of the test generator.</p>
<p><strong>Fix in SQL:</strong><br />
Fix bug in <tt style="background: #ebebeb; font-size: 13px;">sql-mysql.xml</tt>, <tt style="background: #ebebeb; font-size: 13px;">sql-postgresql.xml</tt> & <tt style="background: #ebebeb; font-size: 13px;">sql.xml</tt> files: The single character '/' on a new line (rule: <tt style="background: #ebebeb; font-size: 13px;"><RegExpr String="^/$" ../></tt>) is not highlighted, because it has conflict with the '/' keyword in the "operators" list. This rule is replaced by LineContinue (with column=0) and placed before the rule <tt style="background: #ebebeb; font-size: 13px;"><keyword String="operators" ../></tt>.</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">sql-mysql.xml<ul class="remarkup-list">
<li class="remarkup-list-item">[Line 481] RegExpr -> [Line 394] LineContinue.</li>
</ul></li>
<li class="remarkup-list-item">sql-postgresql.xml<ul class="remarkup-list">
<li class="remarkup-list-item">[761] RegExpr -> [744] LineContinue.</li>
</ul></li>
<li class="remarkup-list-item">sql.xml<ul class="remarkup-list">
<li class="remarkup-list-item">[914] RegExpr -> [897] LineContinue.</li>
</ul></li>
</ul>
<p><strong>Files changed:</strong></p>
<ul class="remarkup-list">
<li class="remarkup-list-item">prolog.xml</li>
<li class="remarkup-list-item">pug.xml<ul class="remarkup-list">
<li class="remarkup-list-item">[Line 36] RegExpr "\belse if\b" is replaced with "\belse\s+if\b". It is much more appropriate than using WordDetect, since it is JavaScript code (is Node.js)</li>
</ul></li>
<li class="remarkup-list-item">qml.xml</li>
<li class="remarkup-list-item">r.xml</li>
<li class="remarkup-list-item">rest.xml<ul class="remarkup-list">
<li class="remarkup-list-item">[Lines 39-40] Merge RegExpr rules.</li>
</ul></li>
<li class="remarkup-list-item">rhtml.xml<ul class="remarkup-list">
<li class="remarkup-list-item">[Lines 586-587] Merge RegExpr rules.</li>
</ul></li>
<li class="remarkup-list-item">rpmspec.xml</li>
<li class="remarkup-list-item">ruby.xml</li>
<li class="remarkup-list-item">sisu.xml</li>
<li class="remarkup-list-item">sql-mysql.xml</li>
<li class="remarkup-list-item">sql-oracle.xml</li>
<li class="remarkup-list-item">sql-postgresql.xml</li>
<li class="remarkup-list-item">sql.xml</li>
<li class="remarkup-list-item">tads3.xml</li>
<li class="remarkup-list-item">tcl.xml</li>
<li class="remarkup-list-item">template-toolkit.xml<ul class="remarkup-list">
<li class="remarkup-list-item">Duplicate rules are deleted.</li>
</ul></li>
<li class="remarkup-list-item">textile.xml<ul class="remarkup-list">
<li class="remarkup-list-item">[Lines 36-39] Merge RegExpr rules.</li>
</ul></li>
<li class="remarkup-list-item">varnishtest.xml</li>
<li class="remarkup-list-item">varnishtest4.xml</li>
<li class="remarkup-list-item">vhdl.xml<ul class="remarkup-list">
<li class="remarkup-list-item">[Lines 511-514] Merge RegExpr rules.</li>
</ul></li>
<li class="remarkup-list-item">wml.xml</li>
<li class="remarkup-list-item">xharbour.xml<ul class="remarkup-list">
<li class="remarkup-list-item">[Line 491] RegExpr ("\d+") -> Int</li>
</ul></li>
<li class="remarkup-list-item">xmldebug.xml<ul class="remarkup-list">
<li class="remarkup-list-item">RegExpr ("\s+") -> DetectSpaces</li>
</ul></li>
<li class="remarkup-list-item">zsh.xml<ul class="remarkup-list">
<li class="remarkup-list-item">RegExpr ("[A-Za-z_]\w*") -> DetectIdentifier</li>
</ul></li>
</ul></div></div><br /><div><strong>TEST PLAN</strong><div><p>I tried most of the changes to avoid problems.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R216 Syntax Highlighting</div></div></div><br /><div><strong>BRANCH</strong><div><div>optimize_many_files (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11543">https://phabricator.kde.org/D11543</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/folding/test.sql_oracle.fold<br />
autotests/html/test.sql_oracle.html<br />
autotests/reference/test.sql_oracle.ref<br />
data/syntax/prolog.xml<br />
data/syntax/pug.xml<br />
data/syntax/qml.xml<br />
data/syntax/r.xml<br />
data/syntax/rest.xml<br />
data/syntax/rhtml.xml<br />
data/syntax/rpmspec.xml<br />
data/syntax/ruby.xml<br />
data/syntax/sisu.xml<br />
data/syntax/sql-mysql.xml<br />
data/syntax/sql-oracle.xml<br />
data/syntax/sql-postgresql.xml<br />
data/syntax/sql.xml<br />
data/syntax/tads3.xml<br />
data/syntax/tcl.xml<br />
data/syntax/template-toolkit.xml<br />
data/syntax/textile.xml<br />
data/syntax/varnishtest.xml<br />
data/syntax/varnishtest4.xml<br />
data/syntax/vhdl.xml<br />
data/syntax/wml.xml<br />
data/syntax/xharbour.xml<br />
data/syntax/xmldebug.xml<br />
data/syntax/zsh.xml</div></div></div><br /><div><strong>To: </strong>nibags<br /><strong>Cc: </strong>Frameworks, michaelh, ngraham<br /></div>