diff options
author | cronolio <salikov.alexey@gmail.com> | 2017-01-27 22:59:39 +0000 |
---|---|---|
committer | cronolio <salikov.alexey@gmail.com> | 2017-01-27 22:59:39 +0000 |
commit | f66fdea608294411a8074ea004e0cc7255e2b742 (patch) | |
tree | 56541941f3f6fa96b057944855515def315b5ec9 /pygments | |
parent | e94f76e9d77fe90d62414f50a488e6418d4bbb1b (diff) | |
download | pygments-f66fdea608294411a8074ea004e0cc7255e2b742.tar.gz |
xorg.py created online with Bitbucket
Diffstat (limited to 'pygments')
-rw-r--r-- | pygments/lexers/xorg.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pygments/lexers/xorg.py b/pygments/lexers/xorg.py new file mode 100644 index 00000000..07df57f5 --- /dev/null +++ b/pygments/lexers/xorg.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.xorg + ~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Xorg configs. + + :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, bygroups +from pygments.token import * + +__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)), + ] + } |