summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-06-07 18:14:32 +0200
committerGeorg Brandl <georg@python.org>2011-06-07 18:14:32 +0200
commit6b59220a9ee3bd57735465142ae315495227b4b0 (patch)
treea05b56714c274bbc053af942d090d68306d45b3c
parentf518ef6c7a6ecad8b59be6532a03da3f67ebcdec (diff)
downloadpygments-6b59220a9ee3bd57735465142ae315495227b4b0.tar.gz
Cleanup and add changelog entry for Nemerle.
-rw-r--r--AUTHORS1
-rw-r--r--CHANGES1
-rw-r--r--pygments/lexers/dotnet.py52
3 files changed, 30 insertions, 24 deletions
diff --git a/AUTHORS b/AUTHORS
index cb468e77..6dc2e9f1 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -85,5 +85,6 @@ Other contributors, listed alphabetically, are:
* Dietmar Winkler -- Modelica lexer
* Nils Winter -- Smalltalk lexer
* Davy Wybiral -- Clojure lexer
+* Alex Zimin -- Nemerle lexer
Many thanks for all contributions!
diff --git a/CHANGES b/CHANGES
index 0f13a2d5..de410820 100644
--- a/CHANGES
+++ b/CHANGES
@@ -15,6 +15,7 @@ Version 1.5
* PyPy Log
* eC
* Nimrod
+ * Nemerle
Version 1.4
diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py
index 6e74af1f..710e6b86 100644
--- a/pygments/lexers/dotnet.py
+++ b/pygments/lexers/dotnet.py
@@ -18,8 +18,8 @@ from pygments import unistring as uni
from pygments.lexers.web import XmlLexer
-__all__ = ['CSharpLexer', 'NemerleLexer', 'BooLexer', 'VbNetLexer', 'CSharpAspxLexer',
- 'VbNetAspxLexer']
+__all__ = ['CSharpLexer', 'NemerleLexer', 'BooLexer', 'VbNetLexer',
+ 'CSharpAspxLexer', 'VbNetAspxLexer']
def _escape(st):
@@ -137,10 +137,10 @@ class CSharpLexer(RegexLexer):
RegexLexer.__init__(self, **options)
+
class NemerleLexer(RegexLexer):
"""
- For `Nemerle <http://nemerle.org>`_
- source code.
+ For `Nemerle <http://nemerle.org>`_ source code.
Additional options accepted:
@@ -158,7 +158,7 @@ class NemerleLexer(RegexLexer):
The default value is ``basic``.
- *New in Pygments 1.4.*
+ *New in Pygments 1.5.*
"""
name = 'Nemerle'
@@ -216,21 +216,24 @@ class NemerleLexer(RegexLexer):
(r'\b(extern)(\s+)(alias)\b', bygroups(Keyword, Text,
Keyword)),
(r'(abstract|and|as|base|catch|def|delegate|'
- r'enum|event|extern|false|finally|'
- r'fun|implements|interface|internal|'
- r'is|macro|match|matches|module|mutable|new|'
- r'null|out|override|params|partial|private|'
- r'protected|public|ref|sealed|static|'
- r'syntax|this|throw|true|try|type|typeof|'
- r'virtual|volatile|when|where|with|'
- r'assert|assert2|async|break|checked|continue|do|else|'
- r'ensures|for|foreach|if|late|lock|new|nolate|'
- r'otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b', Keyword),
+ r'enum|event|extern|false|finally|'
+ r'fun|implements|interface|internal|'
+ r'is|macro|match|matches|module|mutable|new|'
+ r'null|out|override|params|partial|private|'
+ r'protected|public|ref|sealed|static|'
+ r'syntax|this|throw|true|try|type|typeof|'
+ r'virtual|volatile|when|where|with|'
+ r'assert|assert2|async|break|checked|continue|do|else|'
+ r'ensures|for|foreach|if|late|lock|new|nolate|'
+ r'otherwise|regexp|repeat|requires|return|surroundwith|'
+ r'unchecked|unless|using|while|yield)\b', Keyword),
(r'(global)(::)', bygroups(Keyword, Punctuation)),
(r'(bool|byte|char|decimal|double|float|int|long|object|sbyte|'
r'short|string|uint|ulong|ushort)\b\??', Keyword.Type),
- (r'(class|struct|variant|module)(\s+)', bygroups(Keyword, Text), 'class'),
- (r'(namespace|using)(\s+)', bygroups(Keyword, Text), 'namespace'),
+ (r'(class|struct|variant|module)(\s+)', bygroups(Keyword, Text),
+ 'class'),
+ (r'(namespace|using)(\s+)', bygroups(Keyword, Text),
+ 'namespace'),
(cs_ident, Name),
],
'class': [
@@ -241,39 +244,40 @@ class NemerleLexer(RegexLexer):
('(' + cs_ident + r'|\.)+', Name.Namespace, '#pop')
],
'splice-string': [
- (r'[^"$]', String),
+ (r'[^"$]', String),
(r'\$\(', Name, 'splice-string-content'),
(r'\$', Name, 'splice-string-ident'),
(r'\\"', String),
(r'"', String, '#pop')
],
'splice-string2': [
- (r'[^#<>$]', String),
+ (r'[^#<>$]', String),
(r'\$\(', Name, 'splice-string-content'),
(r'\$', Name, 'splice-string-ident'),
(r'<#', String, '#push'),
(r'#>', String, '#pop')
],
'recursive-string': [
- (r'[^#<>]', String),
+ (r'[^#<>]', String),
(r'<#', String, '#push'),
(r'#>', String, '#pop')
],
'splice-string-content': [
- (r'if|match', Keyword),
+ (r'if|match', Keyword),
(r'[~!%^&*+=|\[\]:;,.<>/?-]', Punctuation),
- (cs_ident, Name),
+ (cs_ident, Name),
(r'\(', Name, '#push'),
(r'\)', Name, '#pop')
],
'splice-string-ident': [
- (cs_ident, Name, '#pop'),
+ (cs_ident, Name, '#pop'),
(r'.', String, '#pop')
],
}
def __init__(self, **options):
- level = get_choice_opt(options, 'unicodelevel', self.tokens.keys(), 'basic')
+ level = get_choice_opt(options, 'unicodelevel', self.tokens.keys(),
+ 'basic')
if level not in self._all_tokens:
# compile the regexes now
self._tokens = self.__class__.process_tokendef(level)