ThirdParty/Pygments/pygments/lexers/xorg.py

changeset 6651
e8f3b5568b21
diff -r 1dd52aa8897c -r e8f3b5568b21 ThirdParty/Pygments/pygments/lexers/xorg.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ThirdParty/Pygments/pygments/lexers/xorg.py	Sat Jan 12 12:40:14 2019 +0100
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+"""
+    pygments.lexers.xorg
+    ~~~~~~~~~~~~~~~~~~~~
+
+    Lexers for Xorg configs.
+
+    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+"""
+
+from pygments.lexer import RegexLexer, bygroups
+from pygments.token import Comment, String, Name, Text
+
+__all__ = ['XorgLexer']
+
+
+class XorgLexer(RegexLexer):
+    """Lexer for xorg.conf file."""
+    name = 'Xorg'
+    aliases = ['xorg.conf']
+    filenames = ['xorg.conf']
+    mimetypes = []
+
+    tokens = {
+        'root': [
+            (r'\s+', Text),
+            (r'#.*$', Comment),
+
+            (r'((?:Sub)?Section)(\s+)("\w+")',
+             bygroups(String.Escape, Text, String.Escape)),
+            (r'(End(|Sub)Section)', String.Escape),
+
+            (r'(\w+)(\s+)([^\n#]+)',
+             bygroups(Name.Builtin, Text, Name.Constant)),
+        ],
+    }

eric ide

mercurial