summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2016-02-17 10:41:21 +0100
committerGeorg Brandl <georg@python.org>2016-02-17 10:41:21 +0100
commit6002fcdca5b937a1c78b79bcdb18e38a41924f14 (patch)
tree3b374d8f8f5a31d483f9b9476024d87743d09d5f
parentaadd10d025b2074f26d7df0aa851ebcaedc61783 (diff)
downloadpygments-6002fcdca5b937a1c78b79bcdb18e38a41924f14.tar.gz
NCL: add to changelog, mapping, and fix nits.
-rw-r--r--CHANGES1
-rw-r--r--pygments/lexers/_mapping.py1
-rw-r--r--pygments/lexers/ncl.py16
3 files changed, 10 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES
index 8a0900aa..2273d513 100644
--- a/CHANGES
+++ b/CHANGES
@@ -22,6 +22,7 @@ Version 2.2
* Silver (PR#537)
* HSAIL (PR#518)
* JSGF (PR#546)
+ * NCAR command language (PR#536)
- Added `lexers.find_lexer_class_by_name()`. (#1203)
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
index dc83b63a..e5e08068 100644
--- a/pygments/lexers/_mapping.py
+++ b/pygments/lexers/_mapping.py
@@ -269,6 +269,7 @@ LEXERS = {
'MyghtyJavascriptLexer': ('pygments.lexers.templates', 'JavaScript+Myghty', ('js+myghty', 'javascript+myghty'), (), ('application/x-javascript+myghty', 'text/x-javascript+myghty', 'text/javascript+mygthy')),
'MyghtyLexer': ('pygments.lexers.templates', 'Myghty', ('myghty',), ('*.myt', 'autodelegate'), ('application/x-myghty',)),
'MyghtyXmlLexer': ('pygments.lexers.templates', 'XML+Myghty', ('xml+myghty',), (), ('application/xml+myghty',)),
+ 'NCLLexer': ('pygments.lexers.ncl', 'NCL', ('ncl',), ('*.ncl',), ('text/ncl',)),
'NSISLexer': ('pygments.lexers.installers', 'NSIS', ('nsis', 'nsi', 'nsh'), ('*.nsi', '*.nsh'), ('text/x-nsis',)),
'NasmLexer': ('pygments.lexers.asm', 'NASM', ('nasm',), ('*.asm', '*.ASM'), ('text/x-nasm',)),
'NasmObjdumpLexer': ('pygments.lexers.asm', 'objdump-nasm', ('objdump-nasm',), ('*.objdump-intel',), ('text/x-nasm-objdump',)),
diff --git a/pygments/lexers/ncl.py b/pygments/lexers/ncl.py
index 75f66b02..23eba786 100644
--- a/pygments/lexers/ncl.py
+++ b/pygments/lexers/ncl.py
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
"""
pygments.lexers.ncl
- ~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~
- Lexers for NCL languages (NCAR Command Language).
+ Lexers for NCAR Command Language.
- :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -22,7 +22,7 @@ class NCLLexer(RegexLexer):
"""
Lexer for NCL code.
- .. versionadded:: 0.10
+ .. versionadded:: 2.2
"""
name = 'NCL'
aliases = ['ncl']
@@ -59,11 +59,11 @@ class NCLLexer(RegexLexer):
Keyword.Type),
# Operators
- (r'(\^|\*|\+|-|\/|<|>)', Operator),
+ (r'[\^*+\-/<>]', Operator),
# punctuation:
- (r'\[|\]|\(|\)|:|@|\$|\.|,', Punctuation),
- (r'=|:', Punctuation),
+ (r'[\[\]():@$.,]', Punctuation),
+ (r'[=:]', Punctuation),
# Intrinsics
(words((
@@ -1050,4 +1050,4 @@ class NCLLexer(RegexLexer):
(r'[+-]?\d*\.\d+(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float),
(r'[+-]?\d+\.\d*(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float),
],
- } \ No newline at end of file
+ }