Back to index

moin  1.9.0~rc2
Static Public Attributes
MoinMoin.support.pygments.lexers.compiled.ValaLexer Class Reference
Inheritance diagram for MoinMoin.support.pygments.lexers.compiled.ValaLexer:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.pygments.lexers.compiled.ValaLexer:
Collaboration graph
[legend]

List of all members.

Static Public Attributes

string name = 'Vala'
list aliases = ['vala', 'vapi']
list filenames = ['*.vala', '*.vapi']
list mimetypes = ['text/x-vala']
dictionary tokens

Detailed Description

For Vala source code with preprocessor directives.

*New in Pygments 1.1.*

Definition at line 1577 of file compiled.py.


Member Data Documentation

Definition at line 1584 of file compiled.py.

Definition at line 1585 of file compiled.py.

Definition at line 1586 of file compiled.py.

Definition at line 1583 of file compiled.py.

Initial value:
{
        'whitespace': [
            (r'^\s*#if\s+0', Comment.Preproc, 'if0'),
            (r'\n', Text),
            (r'\s+', Text),
            (r'\\\n', Text), # line continuation
            (r'//(\n|(.|\n)*?[^\\]\n)', Comment.Single),
            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
        ],
        'statements': [
            (r'L?"', String, 'string'),            (r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'",             String.Char),            (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),            (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),            (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),            (r'0[0-7]+[Ll]?', Number.Oct),            (r'\d+[Ll]?', Number.Integer),            (r'[~!%^&*+=|?:<>/-]', Operator),            (r'(\[)(Compact|Immutable|(?:Boolean|Simple)Type)(\])',             bygroups(Punctuation, Name.Decorator, Punctuation)),            # TODO: "correctly" parse complex code attributes            (r'(\[)(CCode|(?:Integer|Floating)Type)',             bygroups(Punctuation, Name.Decorator)),            (r'[()\[\],.]', Punctuation),            (r'(as|base|break|case|catch|construct|continue|default|delete|do|'             r'else|enum|finally|for|foreach|get|if|in|is|lock|new|out|params|'             r'return|set|sizeof|switch|this|throw|try|typeof|while|yield)\b',             Keyword),            (r'(abstract|const|delegate|dynamic|ensures|extern|inline|internal|'             r'override|owned|private|protected|public|ref|requires|signal|'             r'static|throws|unowned|var|virtual|volatile|weak|yields)\b',             Keyword.Declaration),            (r'(namespace|using)(\s+)', bygroups(Keyword.Namespace, Text),             'namespace'),            (r'(class|errordomain|interface|struct)(\s+)',             bygroups(Keyword.Declaration, Text), 'class'),            (r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)',             bygroups(Operator, Name.Attribute)),            # void is an actual keyword, others are in glib-2.0.vapi            (r'(void|bool|char|double|float|int|int8|int16|int32|int64|long|'             r'short|size_t|ssize_t|string|time_t|uchar|uint|uint8|uint16|'             r'uint32|uint64|ulong|unichar|ushort)\b', Keyword.Type),            (r'(true|false|null)\b', Name.Builtin),            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),        ],        'root': [            include('whitespace'),            ('', Text, 'statement'),        ],        'statement' : [            include('whitespace'),            include('statements'),            ('[{}]', Punctuation),            (';', Punctuation, '#pop'),        ],        'string': [            (r'"', String, '#pop'),
            (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),            (r'[^\\"\n]+', String), # all other characters
            (r'\\\n', String), # line continuation
            (r'\\', String), # stray backslash
        ],
        'if0': [
            (r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
            (r'^\s*#el(?:se|if).*\n', Comment.Preproc, '#pop'),
            (r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
            (r'.*?\n', Comment),
        ],
        'class': [
            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
        ],
        'namespace': [
            (r'[a-zA-Z_][a-zA-Z0-9_.]*', Name.Namespace, '#pop')
        ],
    }

Definition at line 1588 of file compiled.py.


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