Back to index

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

List of all members.

Static Public Attributes

string name = 'C++'
list aliases = ['cpp', 'c++']
list filenames = ['*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx']
list mimetypes = ['text/x-c++hdr', 'text/x-c++src']
dictionary tokens

Detailed Description

For C++ source code with preprocessor directives.

Definition at line 164 of file compiled.py.


Member Data Documentation

Definition at line 169 of file compiled.py.

list MoinMoin.support.pygments.lexers.compiled.CppLexer.filenames = ['*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx'] [static]

Definition at line 170 of file compiled.py.

list MoinMoin.support.pygments.lexers.compiled.CppLexer.mimetypes = ['text/x-c++hdr', 'text/x-c++src'] [static]

Definition at line 171 of file compiled.py.

Definition at line 168 of file compiled.py.

Initial value:
{
        'root': [
            (r'^\s*#if\s+0', Comment.Preproc, 'if0'),
            (r'^\s*#', Comment.Preproc, 'macro'),
            (r'\n', Text),
            (r'\s+', Text),
            (r'\\\n', Text), # line continuation
            (r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
            (r'[{}]', Punctuation),
            (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'[()\[\],.;]', Punctuation),            (r'(asm|auto|break|case|catch|const|const_cast|continue|'             r'default|delete|do|dynamic_cast|else|enum|explicit|export|'             r'extern|for|friend|goto|if|mutable|namespace|new|operator|'             r'private|protected|public|register|reinterpret_cast|return|'             r'restrict|sizeof|static|static_cast|struct|switch|template|'             r'this|throw|throws|try|typedef|typeid|typename|union|using|'             r'volatile|virtual|while)\b', Keyword),            (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),            (r'(bool|int|long|float|short|double|char|unsigned|signed|'             r'void|wchar_t)\b', Keyword.Type),            (r'(_{0,2}inline|naked|thread)\b', Keyword.Reserved),            (r'__(asm|int8|based|except|int16|stdcall|cdecl|fastcall|int32|'             r'declspec|finally|int64|try|leave|wchar_t|w64|virtual_inheritance|'             r'uuidof|unaligned|super|single_inheritance|raise|noop|'             r'multiple_inheritance|m128i|m128d|m128|m64|interface|'             r'identifier|forceinline|event|assume)\b', Keyword.Reserved),            (r'(true|false)\b', Keyword.Constant),            (r'NULL\b', Name.Builtin),            ('[a-zA-Z_][a-zA-Z0-9_]*:(?!:)', Name.Label),            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),        ],        'classname': [            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop'),            # template specification            (r'\s*(?=>)', Text, '#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
        ],
        'macro': [
            (r'[^/\n]+', Comment.Preproc),
            (r'/[*](.|\n)*?[*]/', Comment.Multiline),
            (r'//.*?\n', Comment.Single, '#pop'),
            (r'/', Comment.Preproc),
            (r'(?<=\\)\n', Comment.Preproc),
            (r'\n', Comment.Preproc, '#pop'),
        ],
        'if0': [
            (r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
            (r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
            (r'.*?\n', Comment),
        ]
    }

Definition at line 173 of file compiled.py.


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