summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Kasprzyk <ciri@ciri.pl>2014-04-15 00:46:19 +0200
committerPiotr Kasprzyk <ciri@ciri.pl>2014-04-15 00:46:19 +0200
commit0b35f5ffa1ea7e40bf835b65057ce28abb1446ce (patch)
tree8eca8dd0fbb4fc1abca413d591afbed694485a16
parentd5fbe891177b85ada9d54239b1e86be059c63fc9 (diff)
downloadpygments-0b35f5ffa1ea7e40bf835b65057ce28abb1446ce.tar.gz
Fixed #161
-rw-r--r--pygments/lexers/_mapping.py1
-rw-r--r--pygments/lexers/other.py26
-rw-r--r--tests/examplefiles/vctreestatus_hg4
3 files changed, 30 insertions, 1 deletions
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
index 88909fb4..d9311558 100644
--- a/pygments/lexers/_mapping.py
+++ b/pygments/lexers/_mapping.py
@@ -321,6 +321,7 @@ LEXERS = {
'TreetopLexer': ('pygments.lexers.parsers', 'Treetop', ('treetop',), ('*.treetop', '*.tt'), ()),
'TypeScriptLexer': ('pygments.lexers.web', 'TypeScript', ('ts',), ('*.ts',), ('text/x-typescript',)),
'UrbiscriptLexer': ('pygments.lexers.other', 'UrbiScript', ('urbiscript',), ('*.u',), ('application/x-urbiscript',)),
+ 'VCTreeStatusLexer': ('pygments.lexers.other', 'VCTreeStatus', ('vctreestatus',), (), ()),
'VGLLexer': ('pygments.lexers.other', 'VGL', ('vgl',), ('*.rpf',), ()),
'ValaLexer': ('pygments.lexers.compiled', 'Vala', ('vala', 'vapi'), ('*.vala', '*.vapi'), ('text/x-vala',)),
'VbNetAspxLexer': ('pygments.lexers.dotnet', 'aspx-vb', ('aspx-vb',), ('*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'), ()),
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py
index 7cf2421a..7073aaa7 100644
--- a/pygments/lexers/other.py
+++ b/pygments/lexers/other.py
@@ -37,7 +37,7 @@ __all__ = ['BrainfuckLexer', 'BefungeLexer', 'RedcodeLexer', 'MOOCodeLexer',
'MscgenLexer', 'KconfigLexer', 'VGLLexer', 'SourcePawnLexer',
'RobotFrameworkLexer', 'PuppetLexer', 'NSISLexer', 'RPMSpecLexer',
'CbmBasicV2Lexer', 'AutoItLexer', 'RexxLexer', 'APLLexer',
- 'LSLLexer', 'AmbientTalkLexer', 'PawnLexer']
+ 'LSLLexer', 'AmbientTalkLexer', 'PawnLexer', 'VCTreeStatusLexer']
class LSLLexer(RegexLexer):
@@ -4091,3 +4091,27 @@ class PawnLexer(RegexLexer):
(r'.*?\n', Comment),
]
}
+
+class VCTreeStatusLexer(RegexLexer):
+ """
+ For colorizing output of version control status commans, like "hg
+ status" or "svn status".
+
+ .. versionadded:: 2.0
+ """
+ name = 'VCTreeStatus'
+ aliases = ['vctreestatus']
+ filenames = []
+ mimetypes = []
+ tokens = {
+ 'root' : [
+ (r'^A \+ C\s+', Generic.Error),
+ (r'^A\s+\+?\s+', String),
+ (r'^M\s+', Generic.Inserted),
+ (r'^C\s+', Generic.Error),
+ (r'^D\s+', Generic.Deleted),
+ (r'^[\?!]\s+', Comment.Preproc),
+ (r' >\s+.*\n', Comment.Preproc),
+ (r'.*\n', Text)
+ ]
+ }
diff --git a/tests/examplefiles/vctreestatus_hg b/tests/examplefiles/vctreestatus_hg
new file mode 100644
index 00000000..193ed803
--- /dev/null
+++ b/tests/examplefiles/vctreestatus_hg
@@ -0,0 +1,4 @@
+M LICENSE
+M setup.py
+! setup.cfg
+? vctreestatus_hg