Skip to content

Commit

Permalink
[vim] Add the link to the vim Operator syntax color.
Browse files Browse the repository at this point in the history
see #779

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Oct 27, 2019
1 parent 189a924 commit 246cf86
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 30 deletions.
2 changes: 1 addition & 1 deletion formatting-styles/gtk/sarl.lang
Expand Up @@ -24,7 +24,7 @@
limitations under the License.
-->
<!-- Style for SARL 0.10 -->
<!-- Style for SARL 0.11 -->

<language id="sarl" _name="SARL" version="2.0" _section="Source">
<metadata>
Expand Down
4 changes: 2 additions & 2 deletions formatting-styles/latex/sarl-beamer-listing.sty
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions formatting-styles/latex/sarl-colorized-listing.sty
Expand Up @@ -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}
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions formatting-styles/latex/sarl-listing.sty
Expand Up @@ -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}
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion formatting-styles/prettify/lang-sarl.js
Expand Up @@ -23,7 +23,7 @@
* limitations under the License.
*
*/
/* Style for SARL 0.10 */
/* Style for SARL 0.11 */

PR['registerLangHandler'](
PR['createSimpleLexer'](
Expand Down
2 changes: 1 addition & 1 deletion formatting-styles/pygments/sarllexer/__init__.py
Expand Up @@ -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__ = [ ]
4 changes: 2 additions & 2 deletions formatting-styles/pygments/sarllexer/sarl.py
Expand Up @@ -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
Expand All @@ -34,7 +34,7 @@ class SarlLexer(RegexLexer):
"""
For `SARL <http://www.sarl.io>`_ source code.
.. versionadded:: 0.10
.. versionadded:: 0.11
"""

name = 'SARL'
Expand Down
4 changes: 2 additions & 2 deletions formatting-styles/pygments/setup.py
Expand Up @@ -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 =
"""
Expand Down
2 changes: 1 addition & 1 deletion formatting-styles/source-highlight/sarl.lang
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions 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
2 changes: 1 addition & 1 deletion 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
14 changes: 9 additions & 5 deletions formatting-styles/vim/syntax/sarl.vim
@@ -1,6 +1,6 @@
" Vim syntax file
" Language: SARL
" Version: 0.10
" Version: 0.11
"
" $Id$
"
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
Expand Up @@ -70,7 +70,7 @@ public class VimGenerator2 extends AbstractExternalHighlightingFragment2<IStyleA
*/
public static final String FTDETECT_FOLDER = "ftdetect"; //$NON-NLS-1$

private final Map<String, VimSyntaxGroup> hilights = new HashMap<>();
private final Map<String, VimSyntaxGroup> highlights = new HashMap<>();

@Override
protected IStyleAppendable newStyleAppendable() {
Expand Down Expand Up @@ -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<String, VimSyntaxGroup> hilight : this.hilights.entrySet()) {
for (final Entry<String, VimSyntaxGroup> hilight : this.highlights.entrySet()) {
appendCmd(it, "SarlHiLink " + hilight.getKey() + " " + hilight.getValue().getVimConstant()); //$NON-NLS-1$//$NON-NLS-2$
}
clearHilights();
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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$
}
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 246cf86

Please sign in to comment.