misc: update highlighters and indenters
authorJean Privat <jean@pryen.org>
Tue, 25 Apr 2017 16:42:42 +0000 (12:42 -0400)
committerJean Privat <jean@pryen.org>
Wed, 26 Apr 2017 12:31:19 +0000 (08:31 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

misc/gtksourceview/nit.lang
misc/highlight/nit.lang
misc/source-highlight/nit.lang
misc/syntaxhighlighter/shBrushNit.js
misc/vim/indent/nit.vim
misc/vim/syntax/nit.vim

index 8edd22e..2e7a08e 100644 (file)
@@ -84,6 +84,7 @@
     <context id="keywords" style-ref="keyword">
       <keyword>do</keyword>
       <keyword>end</keyword>
+      <keyword>catch</keyword>
       <keyword>intrude</keyword>
       <keyword>private</keyword>
       <keyword>if</keyword>
index 1787113..a1a71ee 100644 (file)
@@ -6,7 +6,7 @@ Digits=[[ (?:0x|0X|0b)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)? ]]
 
 Keywords={
   { Id=1,
-    List={"abort", "abstract", "as", "assert", "break", "continue", "do", "else", "end", "enum", "extern", "for", "if", "import", "in", "interface", "intern", "intrude", "is", "isa", "isset", "new", "label", "loop", "private", "protected", "readable", "return", "super", "then", "while", "false", "null", "nullable", "redef", "self", "true", "and", "not", "or", "fun", "var", "type", "init", "class", "package", "module", "special", "universal", "writable"},
+    List={"abort", "abstract", "as", "assert", "break", "continue", "do", "else", "end", "catch", "enum", "extern", "for", "if", "import", "in", "interface", "intern", "intrude", "is", "isa", "isset", "new", "label", "loop", "private", "protected", "readable", "return", "super", "then", "while", "false", "null", "nullable", "redef", "self", "true", "and", "not", "or", "fun", "var", "type", "init", "class", "package", "module", "special", "universal", "writable"},
   },
   { Id=2,
     Regex=[[[A-Z][\/\w]+]],
index 754266d..2564958 100644 (file)
@@ -29,7 +29,7 @@ environment string delim '(\"{3})' '(\"{3})' escape "\\" multiline begin
        specialchar = '\\.'
 end
 
-keyword = "abort|abstract|as|assert|break|continue|do|else|end|enum|extern|for|if|import|in|interface|intern|intrude|is|isa|isset|new|label|loop|private|protected|readable|return|super|then|while|false|null|nullable|redef|self|true|and|not|or|fun|var|type|init|class|package|module|special|universal|writable"
+keyword = "abort|abstract|as|assert|break|continue|do|else|end|catch|enum|extern|for|if|import|in|interface|intern|intrude|is|isa|isset|new|label|loop|private|protected|readable|return|super|then|while|false|null|nullable|redef|self|true|and|not|or|fun|var|type|init|class|package|module|special|universal|writable"
 
 type = '[[:upper:]]([[:word:]]*)'
 
index e9d1f78..5b6f0ee 100644 (file)
@@ -23,7 +23,7 @@
 
        function Brush()
        {
-               var keywords =  'abort abstract and as assert break class continue do else end enum extern false for fun' +
+               var keywords =  'abort abstract and as assert break class continue do else end catch enum extern false for fun' +
                                                'if import in init interface intrude is isa isset label loop module new null nullable not' +
                                                'once or protected private redef return self super then type true universal var' +
                                                'when while writable';
index 10c4a2e..4e1555d 100644 (file)
@@ -30,7 +30,7 @@ setlocal nosmartindent
 setlocal nocindent
 setlocal autoindent
 setlocal comments=:#
-setlocal indentkeys+==end,=else,=do,=var,0!,=then,=loop,=special,=class,=interface,=universal
+setlocal indentkeys+==end,=else,=catch,=do,=var,0!,=then,=loop,=special,=class,=interface,=universal
 
 " Only define the function once.
 if exists("*GetNITIndent")
@@ -38,9 +38,9 @@ if exists("*GetNITIndent")
 endif
 
 " Indent after
-let s:relative_indent = '\<\(do\|loop\|then\|else\|if\)\s*\(#\|$\)\|^\s*\(\<\(redef\|private\)\>\s*\)\?\(\<abstract\>\s*\)\?\<\(class\|interface\|universal\|special\)\>'
+let s:relative_indent = '\<\(do\|loop\|then\|else\|catch\|if\)\s*\(#\|$\)\|^\s*\(\<\(redef\|private\)\>\s*\)\?\(\<abstract\>\s*\)\?\<\(class\|interface\|universal\|special\)\>'
 " Unindent on them
-let s:outdent = '^\s*\(else\|then\|end\)\>'
+let s:outdent = '^\s*\(catch\|else\|then\|end\)\>'
 " At 0
 let s:no_indent = '^\s*\(class\|import\|special\)\>'
 
index b5d86ac..b72ee52 100644 (file)
@@ -57,7 +57,7 @@ syn match NITClosure "!\h\w*"
 
 " Fallback highlight keywords
 syn match NITNull "\<\(null\)\>"
-syn match NITControl "\<\(init\|end\|not null\|not\|var\|do\|then\|else\|loop\|is\)\>"
+syn match NITControl "\<\(init\|end\|not null\|not\|var\|do\|then\|catch\|else\|loop\|is\)\>"
 syn match NITKeyword "\<\(super\)\>"
 " Unmatchning error
 syn match Error "\<end\>"