summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcronolio <salikov.alexey@gmail.com>2017-01-27 22:59:39 +0000
committercronolio <salikov.alexey@gmail.com>2017-01-27 22:59:39 +0000
commitf66fdea608294411a8074ea004e0cc7255e2b742 (patch)
tree56541941f3f6fa96b057944855515def315b5ec9
parente94f76e9d77fe90d62414f50a488e6418d4bbb1b (diff)
downloadpygments-f66fdea608294411a8074ea004e0cc7255e2b742.tar.gz
xorg.py created online with Bitbucket
-rw-r--r--pygments/lexers/xorg.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/pygments/lexers/xorg.py b/pygments/lexers/xorg.py
new file mode 100644
index 00000000..07df57f5
--- /dev/null
+++ b/pygments/lexers/xorg.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+"""
+ pygments.lexers.xorg
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Lexers for Xorg configs.
+
+ :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+
+from pygments.lexer import RegexLexer, bygroups
+from pygments.token import *
+
+__all__ = ['XorgLexer']
+
+class XorgLexer(RegexLexer):
+ name = 'Xorg'
+ aliases = ['xorg.conf']
+ filenames = []
+ mimetypes = []
+
+ tokens = {
+ 'root': [
+ (r'#.*$', Comment),
+ (r'((|Sub)Section)(\s+)("\w+")', bygroups (String.Escape, String.Escape, Whitespace, String.Escape)),
+ (r'(End(|Sub)Section)', String.Escape),
+
+ (r'(^(?!S|E|#)(|\s+)(?!Sec|End|Sub)\w+)(\s+)([^\n#]+)', bygroups (Name.Builtin, Whitespace, Whitespace, Name.Constant)),
+ ]
+ }