[gtksourceview] julia: update syntax to julia versions > 1.0



commit 727b8715b66db4f5f451e2bf1dd4d79f24e847ae
Author: Joost <joost email com>
Date:   Thu Mar 21 20:21:12 2019 +0100

    julia: update syntax to julia versions > 1.0
    
    Changed keywords to match those used in the stable version of julia.
    Also support for nested block comment is added.
    
    Fixes #22

 data/language-specs/julia.lang | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)
---
diff --git a/data/language-specs/julia.lang b/data/language-specs/julia.lang
index 1a2098e2..3ad9b1b0 100644
--- a/data/language-specs/julia.lang
+++ b/data/language-specs/julia.lang
@@ -25,6 +25,8 @@
   <metadata>
     <property name="globs" >*.jl</property>
     <property name="line-comment-start" >#</property>
+    <property name="block-comment-start">#=</property>
+    <property name="block-comment-end">=#</property>
   </metadata>
 
   <!--
@@ -32,6 +34,7 @@
   The full list of available styles can be found in the `def.lang` file.
   -->
   <styles>
+    <style id="comment"          name="Comment"           map-to="def:comment" />
     <style id="string"           name="String"            map-to="def:string" />
     <style id="character"        name="Character"         map-to="def:character" />
     <style id="number"           name="Number"            map-to="def:number" />
@@ -40,7 +43,7 @@
     <style id="special-constant" name="Special Constant"  map-to="def:special-constant" />
     <style id="operator"         name="Operator"          map-to="def:operator" />
     <style id="keyword"          name="Keyword"           map-to="def:keyword" />
-    <style id="macro"            name="Macro"             map-to="def:keyword" />
+    <style id="macro"            name="Macro"             map-to="def:preprocessor" />
     <style id="external-command" name="External Command"  map-to="def:constant" />
     <style id="builtin-function" name="Built-in Function" map-to="def:builtin" />
     <style id="module"           name="Module"            map-to="def:builtin" />
@@ -101,6 +104,7 @@
 
     <context id="special-constant" style-ref="special-constant">
       <keyword>nothing</keyword>
+      <keyword>missing</keyword>
       <!-- http://docs.julialang.org/en/latest/stdlib/constants/ -->
       <keyword>ARGS</keyword>
       <keyword>LOAD_PATH</keyword>
@@ -112,9 +116,9 @@
       <!-- exports.jl -->
       <keyword>ENDIAN_BOM</keyword>
       <keyword>ENV</keyword>
-      <keyword>STDERR</keyword>
-      <keyword>STDIN</keyword>
-      <keyword>STDOUT</keyword>
+      <keyword>stderr</keyword>
+      <keyword>stdin</keyword>
+      <keyword>stdout</keyword>
       <!-- type-related -->
       <keyword>T</keyword>
       <keyword>ANY</keyword>
@@ -154,7 +158,8 @@
       <keyword>in</keyword>
       <keyword>function</keyword>
       <keyword>if</keyword>
-      <keyword>immutable</keyword>
+      <keyword>struct</keyword>
+      <keyword>mutable struct</keyword>
       <keyword>let</keyword>
       <keyword>quote</keyword>
       <keyword>try</keyword>
@@ -166,7 +171,8 @@
       <keyword>elseif</keyword>
       <keyword>end</keyword>
       <!-- keywords -->
-      <keyword>abstract</keyword>
+      <keyword>abstract type</keyword>
+      <keyword>primitive type</keyword>
       <keyword>bitstype</keyword>
       <keyword>break</keyword>
       <keyword>ccall</keyword>
@@ -183,6 +189,8 @@
       <keyword>return</keyword>
       <keyword>typealias</keyword>
       <keyword>using</keyword>
+      <keyword>where</keyword>
+      <keyword>new</keyword>
     </context>
 
     <!-- See http://docs.julialang.org/en/latest/manual/running-external-programs/ -->
@@ -204,7 +212,6 @@
       <keyword>kwcall</keyword>
       <keyword>throw</keyword>
       <keyword>tuple</keyword>
-      <keyword>Union</keyword>
       <keyword>method_exists</keyword>
       <keyword>applicable</keyword>
       <keyword>invoke</keyword>
@@ -240,7 +247,7 @@
 
     <!-- Sources: base/exports.jl and examples/typetree.jl -->
     <context id="type" style-ref="type">
-      <keyword>Any|None|Nothing|Void</keyword>
+      <keyword>Any|None|Nothing|Missing|Void|Union|Some</keyword>
       <keyword>Type(Constructor|Name|Var|_Array)?|(Union|Data|NonTuple)Type</keyword>
       <keyword>(Abstract|Strided|Bit)?(Array|Matrix|Vector)</keyword>
       <keyword>Abstract(Cmd|RNG|SparseMatrix)</keyword>
@@ -350,8 +357,18 @@
       <keyword>Zip</keyword>
     </context>
 
+    <context id="comment-multiline-nested" style-ref="comment" class-disabled="no-spell-check" 
class="comment" >
+      <start>#=</start>
+      <end>=#</end>
+      <include>
+        <context ref="comment-multiline-nested"/>
+      </include>
+    </context>
+
+
     <context id="julia" class="no-spell-check">
       <include>
+        <context ref="comment-multiline-nested"/>
         <context ref="def:shebang" />
         <context ref="def:shell-like-comment" />
         <context ref="string" />


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