Back to index

moin  1.9.0~rc2
Public Member Functions | Static Public Attributes
MoinMoin.support.pygments.lexers.text.SourcesListLexer Class Reference
Inheritance diagram for MoinMoin.support.pygments.lexers.text.SourcesListLexer:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.pygments.lexers.text.SourcesListLexer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def analyse_text

Static Public Attributes

string name = 'Debian Sourcelist'
list aliases = ['sourceslist', 'sources.list']
list filenames = ['sources.list']
list mimetype = ['application/x-debian-sourceslist']
dictionary tokens

Detailed Description

Lexer that highlights debian sources.list files.

*New in Pygments 0.7.*

Definition at line 61 of file text.py.


Member Function Documentation

Definition at line 102 of file text.py.

00102 
00103     def analyse_text(text):
00104         for line in text.split('\n'):
00105             line = line.strip()
00106             if not (line.startswith('#') or line.startswith('deb ') or
00107                     line.startswith('deb-src ') or not line):
00108                 return False
00109         return True
00110 


Member Data Documentation

list MoinMoin.support.pygments.lexers.text.SourcesListLexer.aliases = ['sourceslist', 'sources.list'] [static]

Definition at line 69 of file text.py.

Definition at line 70 of file text.py.

list MoinMoin.support.pygments.lexers.text.SourcesListLexer.mimetype = ['application/x-debian-sourceslist'] [static]

Definition at line 71 of file text.py.

string MoinMoin.support.pygments.lexers.text.SourcesListLexer.name = 'Debian Sourcelist' [static]

Definition at line 68 of file text.py.

Initial value:
{
        'root': [
            (r'\s+', Text),
            (r'#.*?$', Comment),
            (r'^(deb(?:-src)?)(\s+)',
             bygroups(Keyword, Text), 'distribution')
        ],
        'distribution': [
            (r'#.*?$', Comment, '#pop'),
            (r'\$\(ARCH\)', Name.Variable),
            (r'[^\s$[]+', String),
            (r'\[', String.Other, 'escaped-distribution'),
            (r'\$', String),
            (r'\s+', Text, 'components')
        ],
        'escaped-distribution': [
            (r'\]', String.Other, '#pop'),
            (r'\$\(ARCH\)', Name.Variable),
            (r'[^\]$]+', String.Other),
            (r'\$', String.Other)
        ],
        'components': [
            (r'#.*?$', Comment, '#pop:2'),
            (r'$', Text, '#pop:2'),
            (r'\s+', Text),
            (r'\S+', Keyword.Pseudo),
        ]
    }

Definition at line 73 of file text.py.


The documentation for this class was generated from the following file: