summaryrefslogtreecommitdiff
path: root/pygments/lexers/c_like.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/c_like.py')
-rw-r--r--pygments/lexers/c_like.py28
1 files changed, 23 insertions, 5 deletions
diff --git a/pygments/lexers/c_like.py b/pygments/lexers/c_like.py
index f4a9c299..ba735a6b 100644
--- a/pygments/lexers/c_like.py
+++ b/pygments/lexers/c_like.py
@@ -5,7 +5,7 @@
Lexers for other C-like languages.
- :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -20,7 +20,7 @@ from pygments.lexers.c_cpp import CLexer, CppLexer
from pygments.lexers import _mql_builtins
__all__ = ['PikeLexer', 'NesCLexer', 'ClayLexer', 'ECLexer', 'ValaLexer',
- 'CudaLexer', 'SwigLexer', 'MqlLexer', 'ArduinoLexer']
+ 'CudaLexer', 'SwigLexer', 'MqlLexer', 'ArduinoLexer', 'CharmciLexer']
class PikeLexer(CppLexer):
@@ -105,7 +105,7 @@ class ClayLexer(RegexLexer):
tokens = {
'root': [
(r'\s', Text),
- (r'//.*?$', Comment.Singleline),
+ (r'//.*?$', Comment.Single),
(r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
(r'\b(public|private|import|as|record|variant|instance'
r'|define|overload|default|external|alias'
@@ -245,7 +245,7 @@ class ValaLexer(RegexLexer):
'ulong', 'unichar', 'ushort'), suffix=r'\b'),
Keyword.Type),
(r'(true|false|null)\b', Name.Builtin),
- ('[a-zA-Z_]\w*', Name),
+ (r'[a-zA-Z_]\w*', Name),
],
'root': [
include('whitespace'),
@@ -344,7 +344,7 @@ class SwigLexer(CppLexer):
# SWIG directives
(r'(%[a-z_][a-z0-9_]*)', Name.Function),
# Special variables
- ('\$\**\&?\w+', Name),
+ (r'\$\**\&?\w+', Name),
# Stringification / additional preprocessor directives
(r'##*[a-zA-Z_]\w*', Comment.Preproc),
inherit,
@@ -539,3 +539,21 @@ class ArduinoLexer(CppLexer):
yield index, Name.Function, value
else:
yield index, token, value
+
+class CharmciLexer(CppLexer):
+ """
+ For `Charm++ <https://charm.cs.illinois.edu>`_ interface files (.ci).
+ """
+
+ name = 'Charmci'
+ aliases = ['charmci']
+ filenames = ['*.ci']
+
+ tokens = {
+ 'statements': [
+ (r'(module)(\s+)', bygroups(Keyword, Text), 'classname'),
+ (words(('mainmodule','mainchare','chare','array','group','nodegroup','message','conditional')), Keyword),
+ (words(('entry','aggregate','threaded','sync','exclusive','nokeep','notrace','immediate','expedited','inline','local','python','accel','readwrite','writeonly','accelblock','memcritical','packed','varsize','initproc','initnode','initcall','stacksize','createhere','createhome','reductiontarget','iget','nocopy','mutable','migratable','readonly')), Keyword),
+ inherit,
+ ],
+ }