Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
xorg.py39 linesDownload Raw Back to lexers
1"""2    pygments.lexers.xorg3    ~~~~~~~~~~~~~~~~~~~~4 5    Lexers for Xorg configs.6 7    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.8    :license: BSD, see LICENSE for details.9"""10 11from pygments.lexer import RegexLexer, bygroups12from pygments.token import Comment, String, Name, Text13 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    version_added = ''25 26    tokens = {27        'root': [28            (r'\s+', Text),29            (r'#.*$', Comment),30 31            (r'((?:Sub)?Section)(\s+)("\w+")',32             bygroups(String.Escape, Text, String.Escape)),33            (r'(End(?:Sub)?Section)', String.Escape),34 35            (r'(\w+)(\s+)([^\n#]+)',36             bygroups(Name.Builtin, Text, Name.Constant)),37        ],38    }39 
codekingpro/portable-devtools · Team Ai