From 246cf868a5725c7a638b3c3a2491f0bf53b16742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Galland?= Date: Sun, 27 Oct 2019 16:47:42 +0100 Subject: [PATCH] [vim] Add the link to the vim Operator syntax color. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit see #779 Signed-off-by: Stéphane Galland --- formatting-styles/gtk/sarl.lang | 2 +- formatting-styles/latex/sarl-beamer-listing.sty | 4 ++-- .../latex/sarl-colorized-listing.sty | 4 ++-- formatting-styles/latex/sarl-listing.sty | 4 ++-- formatting-styles/prettify/lang-sarl.js | 2 +- formatting-styles/pygments/sarllexer/__init__.py | 2 +- formatting-styles/pygments/sarllexer/sarl.py | 4 ++-- formatting-styles/pygments/setup.py | 4 ++-- formatting-styles/source-highlight/sarl.lang | 2 +- formatting-styles/vim/README | 4 ++-- formatting-styles/vim/ftdetect/sarl.vim | 2 +- formatting-styles/vim/syntax/sarl.vim | 14 +++++++++----- .../mwe2/externalspec/vim/VimGenerator2.java | 16 ++++++++-------- 13 files changed, 34 insertions(+), 30 deletions(-) diff --git a/formatting-styles/gtk/sarl.lang b/formatting-styles/gtk/sarl.lang index d3160aaa64..b15b4cc5df 100644 --- a/formatting-styles/gtk/sarl.lang +++ b/formatting-styles/gtk/sarl.lang @@ -24,7 +24,7 @@ limitations under the License. --> - + diff --git a/formatting-styles/latex/sarl-beamer-listing.sty b/formatting-styles/latex/sarl-beamer-listing.sty index 047c6eeec0..e043ee1fc9 100644 --- a/formatting-styles/latex/sarl-beamer-listing.sty +++ b/formatting-styles/latex/sarl-beamer-listing.sty @@ -22,7 +22,7 @@ % limitations under the License. % \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{sarl-beamer-listing}[2019/10/11] +\ProvidesPackage{sarl-beamer-listing}[2019/10/27] \newif\ifusesarlcolors\usesarlcolorstrue \DeclareOption{sarlcolors}{\global\usesarlcolorstrue} \DeclareOption{nosarlcolors}{\global\usesarlcolorsfalse} @@ -76,7 +76,7 @@ } \newcommand{\code}[1]{\ifmmode\text{\lstinline[basicstyle=\usebeamertemplate{code inline style}]{#1}}\else\lstinline[basicstyle=\usebeamertemplate{code inline style}]{#1}\fi} \newcommand{\sarl}{\mbox{SARL}\xspace} -\newcommand{\sarlversion}{0.10} +\newcommand{\sarlversion}{0.11} \ifusesarlcolors \setbeamercolor*{code keyword}{fg=SARLkeyword} \setbeamercolor*{code string}{fg=SARLstring} diff --git a/formatting-styles/latex/sarl-colorized-listing.sty b/formatting-styles/latex/sarl-colorized-listing.sty index f30348cf63..8d3e9b6508 100644 --- a/formatting-styles/latex/sarl-colorized-listing.sty +++ b/formatting-styles/latex/sarl-colorized-listing.sty @@ -22,7 +22,7 @@ % limitations under the License. % \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{sarl-colorized-listing}[2019/10/11] +\ProvidesPackage{sarl-colorized-listing}[2019/10/27] \newif\ifusesarlcolors\usesarlcolorstrue \DeclareOption{sarlcolors}{\global\usesarlcolorstrue} \DeclareOption{nosarlcolors}{\global\usesarlcolorsfalse} @@ -81,5 +81,5 @@ } \newcommand{\code}[1]{\ifmmode\text{\lstinline[basicstyle=\normalcolor]{#1}}\else\lstinline[basicstyle=\normalcolor]{#1}\fi} \newcommand{\sarl}{\mbox{SARL}\xspace} -\newcommand{\sarlversion}{0.10} +\newcommand{\sarlversion}{0.11} \endinput diff --git a/formatting-styles/latex/sarl-listing.sty b/formatting-styles/latex/sarl-listing.sty index baafc1fda3..4f16cc3516 100644 --- a/formatting-styles/latex/sarl-listing.sty +++ b/formatting-styles/latex/sarl-listing.sty @@ -22,7 +22,7 @@ % limitations under the License. % \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{sarl-listing}[2019/10/11] +\ProvidesPackage{sarl-listing}[2019/10/27] \RequirePackage{algpseudocode} \RequirePackage{listings} \RequirePackage{xspace} @@ -63,5 +63,5 @@ } \newcommand{\code}[1]{\ifmmode\text{\lstinline[basicstyle={}]{#1}}\else\lstinline[basicstyle={}]{#1}\fi} \newcommand{\sarl}{\mbox{SARL}\xspace} -\newcommand{\sarlversion}{0.10} +\newcommand{\sarlversion}{0.11} \endinput diff --git a/formatting-styles/prettify/lang-sarl.js b/formatting-styles/prettify/lang-sarl.js index 9b16fac4f8..d626ad1ae2 100644 --- a/formatting-styles/prettify/lang-sarl.js +++ b/formatting-styles/prettify/lang-sarl.js @@ -23,7 +23,7 @@ * limitations under the License. * */ -/* Style for SARL 0.10 */ +/* Style for SARL 0.11 */ PR['registerLangHandler']( PR['createSimpleLexer']( diff --git a/formatting-styles/pygments/sarllexer/__init__.py b/formatting-styles/pygments/sarllexer/__init__.py index c1512d5971..6aecbf2e37 100644 --- a/formatting-styles/pygments/sarllexer/__init__.py +++ b/formatting-styles/pygments/sarllexer/__init__.py @@ -22,7 +22,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# Style for SARL 0.10 +# Style for SARL 0.11 __all__ = [ ] diff --git a/formatting-styles/pygments/sarllexer/sarl.py b/formatting-styles/pygments/sarllexer/sarl.py index e40ccaa4f8..f8f232825d 100644 --- a/formatting-styles/pygments/sarllexer/sarl.py +++ b/formatting-styles/pygments/sarllexer/sarl.py @@ -22,7 +22,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# Style for SARL 0.10 +# Style for SARL 0.11 import re @@ -34,7 +34,7 @@ class SarlLexer(RegexLexer): """ For `SARL `_ source code. - .. versionadded:: 0.10 + .. versionadded:: 0.11 """ name = 'SARL' diff --git a/formatting-styles/pygments/setup.py b/formatting-styles/pygments/setup.py index d96ca57333..1b8ed2ad93 100644 --- a/formatting-styles/pygments/setup.py +++ b/formatting-styles/pygments/setup.py @@ -22,14 +22,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# Style for SARL 0.10 +# Style for SARL 0.11 from setuptools import setup setup ( name='sarl.pylexer', - version='0.10', + version='0.11', packages=['sarl.pylexer'], entry_points = """ diff --git a/formatting-styles/source-highlight/sarl.lang b/formatting-styles/source-highlight/sarl.lang index c5b4f9e645..321d15f838 100644 --- a/formatting-styles/source-highlight/sarl.lang +++ b/formatting-styles/source-highlight/sarl.lang @@ -21,7 +21,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# Style for SARL 0.10 +# Style for SARL 0.11 preproc = "import","package" diff --git a/formatting-styles/vim/README b/formatting-styles/vim/README index 6e01a184f9..ad117c6cf2 100644 --- a/formatting-styles/vim/README +++ b/formatting-styles/vim/README @@ -1,9 +1,9 @@ 1. MANUAL INSTALLATION -Fox Unix: +For Unix: * Copy the content of the 'syntax' folder into $HOME/.vim/syntax * Copy the content of the 'ftdetect' folder into $HOME/.vim/ftdetect -Fox Windows: +For Windows: * Copy the content of the 'syntax' folder into C:\Document and Settings\User\vimfiles\syntax * Copy the content of the 'ftdetect' folder into C:\Document and Settings\User\vimfiles\ftdetect diff --git a/formatting-styles/vim/ftdetect/sarl.vim b/formatting-styles/vim/ftdetect/sarl.vim index 5ac59361d8..5ad9cde052 100644 --- a/formatting-styles/vim/ftdetect/sarl.vim +++ b/formatting-styles/vim/ftdetect/sarl.vim @@ -1,5 +1,5 @@ " Vim filetype-detection file " Language: SARL -" Version: 0.10 +" Version: 0.11 au BufRead,BufNewFile *.sarl set filetype=sarl diff --git a/formatting-styles/vim/syntax/sarl.vim b/formatting-styles/vim/syntax/sarl.vim index 2f2b01bac5..6637a5e021 100644 --- a/formatting-styles/vim/syntax/sarl.vim +++ b/formatting-styles/vim/syntax/sarl.vim @@ -1,6 +1,6 @@ " Vim syntax file " Language: SARL -" Version: 0.10 +" Version: 0.11 " " $Id$ " @@ -101,6 +101,9 @@ syn cluster sarlTop add=sarlModifier syn keyword sarlKeyword as assert assume break case catch continue default do else extends finally fires for if implements instanceof new on requires return super switch throw throws try typeof uses while with syn cluster sarlTop add=sarlKeyword +" punctuation +syn match sarlPunctuation "\([!#%&()*+,-./:;<=>?@\[\\\]\^{\|}]\)" + " catch errors caused by wrong parenthesis syn region sarlParenT transparent matchgroup=sarlParen start="(" end=")" contains=@sarlTop,sarlParenT1 syn region sarlParenT1 transparent matchgroup=sarlParen1 start="(" end=")" contains=@sarlTop,sarlParenT2 contained @@ -120,18 +123,19 @@ endif exec "syn sync ccomment sarlComment minlines=" . sarl_minlines " The default highlighting. -SarlHiLink sarlComment Comment SarlHiLink sarlNumber Constant -SarlHiLink sarlString Constant +SarlHiLink sarlPunctuation Operator SarlHiLink sarlTypeDeclaration Type SarlHiLink sarlLineComment Comment SarlHiLink sarlLiteral Identifier -SarlHiLink sarlKeyword Statement SarlHiLink sarlAnnotation PreProc SarlHiLink sarlArrayDeclaration Special -SarlHiLink sarlSpecial Special SarlHiLink sarlPrimitiveType Special SarlHiLink sarlModifier Statement +SarlHiLink sarlComment Comment +SarlHiLink sarlString Constant +SarlHiLink sarlKeyword Statement +SarlHiLink sarlSpecial Special delcommand SarlHiLink diff --git a/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java b/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java index 72fc2120cc..041200c614 100644 --- a/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java +++ b/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java @@ -70,7 +70,7 @@ public class VimGenerator2 extends AbstractExternalHighlightingFragment2 hilights = new HashMap<>(); + private final Map highlights = new HashMap<>(); @Override protected IStyleAppendable newStyleAppendable() { @@ -185,7 +185,7 @@ protected void generatePostamble(IStyleAppendable it) { appendCmd(it, "exec \"syn sync ccomment sarlComment minlines=\" . sarl_minlines"); //$NON-NLS-1$ it.newLine(); appendComment(it, "The default highlighting."); //$NON-NLS-1$ - for (final Entry hilight : this.hilights.entrySet()) { + for (final Entry hilight : this.highlights.entrySet()) { appendCmd(it, "SarlHiLink " + hilight.getKey() + " " + hilight.getValue().getVimConstant()); //$NON-NLS-1$//$NON-NLS-2$ } clearHilights(); @@ -328,7 +328,7 @@ protected void generateKeywords(IStyleAppendable it, String family, VimSyntaxGro /** Clear the hilight definitions. */ protected void clearHilights() { - this.hilights.clear(); + this.highlights.clear(); } /** Hilight the group with the given name as the given Vim syntax group. @@ -337,7 +337,7 @@ protected void clearHilights() { * @param group the Vim syntax group. */ protected void hilight(String name, VimSyntaxGroup group) { - this.hilights.put(name, group); + this.highlights.put(name, group); } /** Append elements to the Vim top cluster. @@ -561,11 +561,11 @@ protected Object getReadmeFileContent(String basename) { return concat( "1. MANUAL INSTALLATION", //$NON-NLS-1$ "", //$NON-NLS-1$ - "Fox Unix:", //$NON-NLS-1$ + "For Unix:", //$NON-NLS-1$ "* Copy the content of the 'syntax' folder into $HOME/.vim/syntax", //$NON-NLS-1$ "* Copy the content of the 'ftdetect' folder into $HOME/.vim/ftdetect", //$NON-NLS-1$ "", //$NON-NLS-1$ - "Fox Windows:", //$NON-NLS-1$ + "For Windows:", //$NON-NLS-1$ "* Copy the content of the 'syntax' folder into C:\\Document and Settings\\User\\vimfiles\\syntax", //$NON-NLS-1$ "* Copy the content of the 'ftdetect' folder into C:\\Document and Settings\\User\\vimfiles\\ftdetect"); //$NON-NLS-1$ } @@ -708,9 +708,9 @@ protected enum VimSyntaxGroup { /** To-Do. */ TODO("Todo"), //$NON-NLS-1$ - /** Error. + /** Operator. */ - ERROR("Error"); //$NON-NLS-1$ + OPERATOR("Operator"); //$NON-NLS-1$ private final String vimConstant;