Anyone tested katepart syntax javascript.xml lately

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All,

  Ran into an issue with a version of kdelibs/kate/part/data/javascript.xml
(tdelibs here) where the syntax highlight would not render in kate/kwrite. (at
all -- meaning no syntax highlight at all for .js) The syntax file was
identical to:

https://git.trinitydesktop.org/cgit/tdelibs/tree/kate/data/javascript.xml

  Reverting to an earlier version restored the syntax highlighting for javascript.

  It would be worth a check. If it doesn't render, then here is a diff of the
changes between the current and the one that works. If your current version
works -- just disregard.




-- 
David C. Rankin, J.D.,P.E.
--- javascripttde.xml	2018-06-08 17:03:52.071095287 -0500
+++ /home/david/.kde/share/apps/katepart/syntax/javascript.xml	2014-01-19 05:59:20.000000000 -0600
@@ -3,7 +3,7 @@
 <!-- Author: Anders Lund <anders@xxxxxxxx> //-->
 <!-- Minor changes: Joseph Wenninger <jowenn@xxxxxxx> //-->
 <!-- Full JavaScript 1.0 support by Whitehawk Stormchaser //-->
-<language name="JavaScript" version="1.22-1" kateversion="2.4" section="Scripts" extensions="*.js;*.kwinscript"
+<language name="JavaScript" version="1.23" kateversion="2.5" section="Scripts" extensions="*.js;*.kwinscript"
           mimetype="text/x-javascript;application/x-javascript" indenter="cstyle"
           author="Anders Lund (anders@xxxxxxxx), Joseph Wenninger (jowenn@xxxxxxx), Whitehawk Stormchaser (zerokode@xxxxxxx)" license="">
   <highlighting>
@@ -64,18 +64,6 @@
       <item> undefined </item>
     </list>
     <contexts>
-
-      <!-- Shebang: ("#!") Detect shebang and fallthrough to Normal -->
-      <!-- Based on the similar clause from prolog.xml, which notes the following BUG:
-        If the file starts with whitespace and a shebang on a line other than the first line,
-        this rule will still match it as a shebang, even tough the shebang is only valid on
-        the very first line.
-      -->
-      <context name="Shebang" lineEndContext="Normal" attribute="Syntax Error" fallthrough="true" fallthroughContext="Normal" >
-        <Detect2Chars column="0" char="#" char1="!" context="Comment" attribute="Comment" />
-				<IncludeRules context="Normal" />
-      </context>
-
       <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
         <DetectSpaces/>
         <StringDetect attribute="Region Marker" context="region_marker" String="//BEGIN" beginRegion="Region1" />
@@ -114,13 +102,16 @@
         <AnyChar attribute="Symbol" String=":!%&amp;+,-/.*&lt;=&gt;?|~^&#59;" />
       </context>
 
-      <context attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" name="Object Member">
+      <context attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop" name="Object Member">
         <DetectChar char="." />
         <!--DetectIdentifier-->
         <RegExpr attribute="Objects" context="Object Member" String="[a-zA-Z_$][\w$]*(?=\s*\.)" />
         <!--DetectIdentifier-->
         <RegExpr attribute="Object Member" String="[a-zA-Z_$][\w$]*" />
-        <IncludeRules context="NoRegExp" />
+        <!-- NoRegExp without DetectSpaces. TODO: code reuse without detecting spaces as object member? -->
+        <Detect2Chars context="#pop" lookAhead="true" char="/" char1="/" />
+        <Detect2Chars context="#pop" lookAhead="true" char="/" char1="*" />
+        <DetectChar context="#pop" char="/" />
       </context>
 
       <context attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop" name="NoRegExp">

---------------------------------------------------------------------
To unsubscribe, e-mail: trinity-devel-unsubscribe@xxxxxxxxxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: trinity-devel-help@xxxxxxxxxxxxxxxxxxxxxxxxxx
Read list messages on the web archive: http://trinity-devel.pearsoncomputing.net/
Please remember not to top-post: http://trinity.pearsoncomputing.net/mailing_lists/#top-posting

[Index of Archives]     [Trinity Users]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [KDE]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux