From 020bb117812fa32309953cf6d3fdeed59db9326c Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Tue, 25 Apr 2017 12:42:42 -0400 Subject: [PATCH] misc: update highlighters and indenters Signed-off-by: Jean Privat --- misc/gtksourceview/nit.lang | 1 + misc/highlight/nit.lang | 2 +- misc/source-highlight/nit.lang | 2 +- misc/syntaxhighlighter/shBrushNit.js | 2 +- misc/vim/indent/nit.vim | 6 +++--- misc/vim/syntax/nit.vim | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/misc/gtksourceview/nit.lang b/misc/gtksourceview/nit.lang index 8edd22e..2e7a08e 100644 --- a/misc/gtksourceview/nit.lang +++ b/misc/gtksourceview/nit.lang @@ -84,6 +84,7 @@ do end + catch intrude private if diff --git a/misc/highlight/nit.lang b/misc/highlight/nit.lang index 1787113..a1a71ee 100644 --- a/misc/highlight/nit.lang +++ b/misc/highlight/nit.lang @@ -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]+]], diff --git a/misc/source-highlight/nit.lang b/misc/source-highlight/nit.lang index 754266d..2564958 100644 --- a/misc/source-highlight/nit.lang +++ b/misc/source-highlight/nit.lang @@ -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:]]*)' diff --git a/misc/syntaxhighlighter/shBrushNit.js b/misc/syntaxhighlighter/shBrushNit.js index e9d1f78..5b6f0ee 100644 --- a/misc/syntaxhighlighter/shBrushNit.js +++ b/misc/syntaxhighlighter/shBrushNit.js @@ -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'; diff --git a/misc/vim/indent/nit.vim b/misc/vim/indent/nit.vim index 10c4a2e..4e1555d 100644 --- a/misc/vim/indent/nit.vim +++ b/misc/vim/indent/nit.vim @@ -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*\)\?\(\\s*\)\?\<\(class\|interface\|universal\|special\)\>' +let s:relative_indent = '\<\(do\|loop\|then\|else\|catch\|if\)\s*\(#\|$\)\|^\s*\(\<\(redef\|private\)\>\s*\)\?\(\\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\)\>' diff --git a/misc/vim/syntax/nit.vim b/misc/vim/syntax/nit.vim index b5d86ac..b72ee52 100644 --- a/misc/vim/syntax/nit.vim +++ b/misc/vim/syntax/nit.vim @@ -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 "\" -- 1.7.9.5