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

1""" 

2 pygments.lexers.xorg 

3 ~~~~~~~~~~~~~~~~~~~~ 

4 

5 Lexers for Xorg configs. 

6 

7 :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. 

8 :license: BSD, see LICENSE for details. 

9""" 

10 

11from pygments.lexer import RegexLexer, bygroups 

12from pygments.token import Comment, String, Name, Text 

13 

14__all__ = ['XorgLexer'] 

15 

16 

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 = [] 

24 

25 tokens = { 

26 'root': [ 

27 (r'\s+', Text), 

28 (r'#.*$', Comment), 

29 

30 (r'((?:Sub)?Section)(\s+)("\w+")', 

31 bygroups(String.Escape, Text, String.Escape)), 

32 (r'(End(?:Sub)?Section)', String.Escape), 

33 

34 (r'(\w+)(\s+)([^\n#]+)', 

35 bygroups(Name.Builtin, Text, Name.Constant)), 

36 ], 

37 }