diff options
Diffstat (limited to 'pygments/lexers/compiled.py')
-rw-r--r-- | pygments/lexers/compiled.py | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index 599d23ac..3b99f46c 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -23,11 +23,12 @@ from pygments.scanner import Scanner from pygments.lexers.functional import OcamlLexer from pygments.lexers.jvm import JavaLexer, ScalaLexer -__all__ = ['CLexer', 'CppLexer', 'DLexer', 'DelphiLexer', 'ECLexer', 'DylanLexer', - 'ObjectiveCLexer', 'ObjectiveCppLexer', 'FortranLexer', 'GLShaderLexer', - 'PrologLexer', 'CythonLexer', 'ValaLexer', 'OocLexer', 'GoLexer', - 'FelixLexer', 'AdaLexer', 'Modula2Lexer', 'BlitzMaxLexer', 'BlitzBasicLexer', - 'NimrodLexer', 'FantomLexer', 'RustLexer', 'CudaLexer', 'MonkeyLexer', +__all__ = ['CLexer', 'CppLexer', 'DLexer', 'DelphiLexer', 'ECLexer', + 'NesCLexer', 'DylanLexer', 'ObjectiveCLexer', 'ObjectiveCppLexer', + 'FortranLexer', 'GLShaderLexer', 'PrologLexer', 'CythonLexer', + 'ValaLexer', 'OocLexer', 'GoLexer', 'FelixLexer', 'AdaLexer', + 'Modula2Lexer', 'BlitzMaxLexer', 'BlitzBasicLexer', 'NimrodLexer', + 'FantomLexer', 'RustLexer', 'CudaLexer', 'MonkeyLexer', 'DylanLidLexer', 'DylanConsoleLexer', 'CobolLexer', 'CobolFreeformatLexer', 'LogosLexer', 'ClayLexer'] @@ -266,6 +267,30 @@ class ECLexer(CLexer): } +class NesCLexer(CLexer): + """ + For `nesC <https://github.com/tinyos/nesc>`_ source code with preprocessor + directives. + """ + name = 'nesC' + aliases = ['nesc'] + filenames = ['*.nc'] + mimetypes = ['text/x-nescsrc'] + + tokens = { + 'statements': [ + (r'(abstract|as|async|atomic|call|command|component|components|' + r'configuration|event|extends|generic|implementation|includes|' + r'interface|module|new|norace|post|provides|signal|task|uses)\b', + Keyword), + (r'(nx_struct|nx_union|nx_int8_t|nx_int16_t|nx_int32_t|nx_int64_t|' + r'nx_uint8_t|nx_uint16_t|nx_uint32_t|nx_uint64_t)\b', + Keyword.Type), + inherit, + ], + } + + class ClayLexer(RegexLexer): """ For `Clay <http://claylabs.com/clay/>`_ source. |