<table><tr><td style="">nalvarez created this revision.<br />Restricted Application added a project: Frameworks.<br />Restricted Application added a subscriber: Frameworks.
</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/D5788" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Add syntax highlighting for YANG data modeling language, based on <a href="http://www.yang-central.org/twiki/pub/Main/YangTools/yang.vim" class="remarkup-link" target="_blank" rel="noreferrer">yang.vim</a>.</p>
<p>Improvements from yang.vim:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Character escapes such as <tt style="background: #ebebeb; font-size: 13px;">\n</tt> in <tt style="background: #ebebeb; font-size: 13px;">"foo\nbar"</tt> are highlighted in a different color</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">'foo\'bar'</tt> is highlighted correctly (string ends at first <tt style="background: #ebebeb; font-size: 13px;">'</tt> regardless of backslash). yang.vim wrongly interprets <tt style="background: #ebebeb; font-size: 13px;">\\</tt> and <tt style="background: #ebebeb; font-size: 13px;">\'</tt> as escapes in single-quoted strings.</li>
</ul>
<p>Regressions from yang.vim (which I may fix later):</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Numbers don't have special highlighting and look like normal text.</li>
<li class="remarkup-list-item">"Dates" and "lengths" don't have special highlighting and look like normal strings.</li>
</ul>
<p>I also don't highlight identifiers starting with <tt style="background: #ebebeb; font-size: 13px;">xml</tt> as an error (which yang.vim does), but it seems like that's a YANG 1.0 restriction that was removed in YANG 1.1.</p>
<p><em>Also</em> the XML code ended up unreadable with little whitespace. Hit me with that in code review.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Manually tested with random samples copied from the RFC, comparing the result between Vim and KWrite. However those can't be used as test cases for licensing reasons. Perhaps <a href="https://phabricator.kde.org/p/jkt/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;" rel="noreferrer">@jkt</a> can provide a usable test file?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R216 Syntax Highlighting</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D5788" rel="noreferrer">https://phabricator.kde.org/D5788</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>data/syntax/yang.xml</div></div></div><br /><div><strong>To: </strong>nalvarez, Kate, jkt<br /><strong>Cc: </strong>jkt, Frameworks<br /></div>