diff options
Diffstat (limited to 'pygments/lexers/xorg.py')
-rw-r--r-- | pygments/lexers/xorg.py | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/pygments/lexers/xorg.py b/pygments/lexers/xorg.py index 07df57f5..1344f6e5 100644 --- a/pygments/lexers/xorg.py +++ b/pygments/lexers/xorg.py @@ -1,33 +1,34 @@ # -*- coding: utf-8 -*- """ pygments.lexers.xorg - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~ Lexers for Xorg configs. - :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ -import re - from pygments.lexer import RegexLexer, bygroups -from pygments.token import * +from pygments.token import Comment, String, Name, Text __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)), - ] - } + name = 'Xorg' + aliases = ['xorg.conf'] + filenames = ['xorg.conf'] + mimetypes = [] + + tokens = { + 'root': [ + (r'#.*$', Comment), + (r'((|Sub)Section)(\s+)("\w+")', + bygroups(String.Escape, String.Escape, Text, String.Escape)), + (r'(End(|Sub)Section)', String.Escape), + + (r'(^(?!S|E|#)(|\s+)(?!Sec|End|Sub)\w+)(\s+)([^\n#]+)', + bygroups(Name.Builtin, Text, Text, Name.Constant)), + ], + } |