eric6/ThirdParty/Pygments/pygments/lexers/xorg.py

changeset 6942
2602857055c5
parent 6651
e8f3b5568b21
child 7547
21b0534faebc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric6/ThirdParty/Pygments/pygments/lexers/xorg.py	Sun Apr 14 15:09:21 2019 +0200
@@ -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