Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pygments/lexers/xorg.py: 100%
10 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:16 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:16 +0000
1"""
2 pygments.lexers.xorg
3 ~~~~~~~~~~~~~~~~~~~~
5 Lexers for Xorg configs.
7 :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8 :license: BSD, see LICENSE for details.
9"""
11from pygments.lexer import RegexLexer, bygroups
12from pygments.token import Comment, String, Name, Text
14__all__ = ['XorgLexer']
17class XorgLexer(RegexLexer):
18 """Lexer for xorg.conf files."""
19 name = 'Xorg'
20 url = 'https://www.x.org/wiki/'
21 aliases = ['xorg.conf']
22 filenames = ['xorg.conf']
23 mimetypes = []
25 tokens = {
26 'root': [
27 (r'\s+', Text),
28 (r'#.*$', Comment),
30 (r'((?:Sub)?Section)(\s+)("\w+")',
31 bygroups(String.Escape, Text, String.Escape)),
32 (r'(End(?:Sub)?Section)', String.Escape),
34 (r'(\w+)(\s+)([^\n#]+)',
35 bygroups(Name.Builtin, Text, Name.Constant)),
36 ],
37 }