Location: PHPKode > projects > Content*Builder > cb_pear/Text/Highlighter/PYTHON.php
<?php
/**
 * Auto-generated class. PYTHON syntax highlighting
 * @package Text_Highlighter
 *
 * @author Andrey Demenev <hide@address.com>
 */

/**
 * @ignore
 */

require_once 'Text/Highlighter.php';

/**
 * Auto-generated class. PYTHON syntax highlighting
 *
 *
 * Custom color groups defined by this highlighter :
 *
 * builtin
 *
 * @author Andrey Demenev <hide@address.com>
 * @package Text_Highlighter
 */
class  Text_Highlighter_PYTHON extends Text_Highlighter
{    /**
     * PHP4 Compatible Constructor
     *
     * @param array  $options
     * @access public
     */
    function Text_Highlighter_PYTHON($options=array())
    {
        $this->__construct($options);
    }


    /**
     *  Constructor
     *
     * @param array  $options
     * @access public
     */
    function __construct($options=array())
    {
        $this->_syntax = array (
            'regions' => 
            array (
                'strsingle3' => 
                array (
                    'name' => 'strsingle3',
                    'case' => false,
                    'innerColor' => 'string',
                    'delimColor' => 'quotes',
                    'start' => '/\'\'\'/i',
                    'end' => '/\'\'\'/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'blocks' => 
                        array (
                            0 => 'escaped',
                        ),
                    ),
                ),
                'strdouble3' => 
                array (
                    'name' => 'strdouble3',
                    'case' => false,
                    'innerColor' => 'string',
                    'delimColor' => 'quotes',
                    'start' => '/"""/i',
                    'end' => '/"""/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'blocks' => 
                        array (
                            0 => 'escaped',
                        ),
                    ),
                ),
                'strdouble' => 
                array (
                    'name' => 'strdouble',
                    'case' => false,
                    'innerColor' => 'string',
                    'delimColor' => 'quotes',
                    'start' => '/"/i',
                    'end' => '/"/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'blocks' => 
                        array (
                            0 => 'escaped',
                        ),
                    ),
                ),
                'strsingle' => 
                array (
                    'name' => 'strsingle',
                    'case' => false,
                    'innerColor' => 'string',
                    'delimColor' => 'quotes',
                    'start' => '/\'/i',
                    'end' => '/\'/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'blocks' => 
                        array (
                            0 => 'escaped',
                        ),
                    ),
                ),
                'brackets' => 
                array (
                    'name' => 'brackets',
                    'case' => false,
                    'innerColor' => 'code',
                    'delimColor' => 'brackets',
                    'start' => '/\\(/i',
                    'end' => '/\\)/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'regions' => 
                        array (
                            0 => 'strsingle3',
                            1 => 'strdouble3',
                            2 => 'strdouble',
                            3 => 'strsingle',
                            4 => 'brackets',
                            5 => 'sqbrackets',
                        ),
                        'blocks' => 
                        array (
                            0 => 'possiblefunction',
                            1 => 'identifier',
                            2 => 'exponent',
                            3 => 'imaginary',
                            4 => 'float',
                            5 => 'integer',
                            6 => 'hexinteger',
                            7 => 'octinteger',
                            8 => 'comment',
                        ),
                    ),
                ),
                'sqbrackets' => 
                array (
                    'name' => 'sqbrackets',
                    'case' => false,
                    'innerColor' => 'code',
                    'delimColor' => 'brackets',
                    'start' => '/\\[/i',
                    'end' => '/\\]/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'regions' => 
                        array (
                            0 => 'strsingle3',
                            1 => 'strdouble3',
                            2 => 'strdouble',
                            3 => 'strsingle',
                            4 => 'brackets',
                            5 => 'sqbrackets',
                        ),
                        'blocks' => 
                        array (
                            0 => 'possiblefunction',
                            1 => 'identifier',
                            2 => 'exponent',
                            3 => 'imaginary',
                            4 => 'float',
                            5 => 'integer',
                            6 => 'hexinteger',
                            7 => 'octinteger',
                            8 => 'comment',
                        ),
                    ),
                ),
            ),
            'keywords' => 
            array (
                'reserved' => 
                array (
                    'name' => 'reserved',
                    'innerColor' => 'reserved',
                    'case' => true,
                    'inherits' => 'identifier',
                    'match' => 
                    array (
                        'and' => true,
                        'del' => true,
                        'for' => true,
                        'is' => true,
                        'raise' => true,
                        'assert' => true,
                        'elif' => true,
                        'from' => true,
                        'lambda' => true,
                        'return' => true,
                        'break' => true,
                        'else' => true,
                        'global' => true,
                        'not' => true,
                        'try' => true,
                        'class' => true,
                        'except' => true,
                        'if' => true,
                        'or' => true,
                        'while' => true,
                        'continue' => true,
                        'exec' => true,
                        'import' => true,
                        'pass' => true,
                        'yield' => true,
                        'def' => true,
                        'finally' => true,
                        'in' => true,
                        'print' => true,
                        'False' => true,
                        'True' => true,
                        'None' => true,
                        'NotImplemented' => true,
                        'Ellipsis' => true,
                        'Exception' => true,
                        'SystemExit' => true,
                        'StopIteration' => true,
                        'StandardError' => true,
                        'KeyboardInterrupt' => true,
                        'ImportError' => true,
                        'EnvironmentError' => true,
                        'IOError' => true,
                        'OSError' => true,
                        'WindowsError' => true,
                        'EOFError' => true,
                        'RuntimeError' => true,
                        'NotImplementedError' => true,
                        'NameError' => true,
                        'UnboundLocalError' => true,
                        'AttributeError' => true,
                        'SyntaxError' => true,
                        'IndentationError' => true,
                        'TabError' => true,
                        'TypeError' => true,
                        'AssertionError' => true,
                        'LookupError' => true,
                        'IndexError' => true,
                        'KeyError' => true,
                        'ArithmeticError' => true,
                        'OverflowError' => true,
                        'ZeroDivisionError' => true,
                        'FloatingPointError' => true,
                        'ValueError' => true,
                        'UnicodeError' => true,
                        'UnicodeEncodeError' => true,
                        'UnicodeDecodeError' => true,
                        'UnicodeTranslateError' => true,
                        'ReferenceError' => true,
                        'SystemError' => true,
                        'MemoryError' => true,
                        'Warning' => true,
                        'UserWarning' => true,
                        'DeprecationWarning' => true,
                        'PendingDeprecationWarning' => true,
                        'SyntaxWarning' => true,
                        'OverflowWarning' => true,
                        'RuntimeWarning' => true,
                        'FutureWarning' => true,
                    ),
                ),
                'builtin' => 
                array (
                    'name' => 'builtin',
                    'innerColor' => 'builtin',
                    'case' => true,
                    'inherits' => 'possiblefunction',
                    'otherwise' => 'identifier',
                    'match' => 
                    array (
                        '__import__' => true,
                        'abs' => true,
                        'apply' => true,
                        'basestring' => true,
                        'bool' => true,
                        'buffer' => true,
                        'callable' => true,
                        'chr' => true,
                        'classmethod' => true,
                        'cmp' => true,
                        'coerce' => true,
                        'compile' => true,
                        'complex' => true,
                        'delattr' => true,
                        'dict' => true,
                        'dir' => true,
                        'divmod' => true,
                        'enumerate' => true,
                        'eval' => true,
                        'execfile' => true,
                        'file' => true,
                        'filter' => true,
                        'float' => true,
                        'getattr' => true,
                        'globals' => true,
                        'hasattr' => true,
                        'hash' => true,
                        'help' => true,
                        'hex' => true,
                        'id' => true,
                        'input' => true,
                        'int' => true,
                        'intern' => true,
                        'isinstance' => true,
                        'issubclass' => true,
                        'iter' => true,
                        'len' => true,
                        'list' => true,
                        'locals' => true,
                        'long' => true,
                        'map' => true,
                        'max' => true,
                        'min' => true,
                        'object' => true,
                        'oct' => true,
                        'open' => true,
                        'ord' => true,
                        'pow' => true,
                        'property' => true,
                        'range' => true,
                        'raw_input' => true,
                        'reduce' => true,
                        'reload' => true,
                        'repr' => true,
                        'round' => true,
                        'setattr' => true,
                        'slice' => true,
                        'staticmethod' => true,
                        'sum' => true,
                        'super' => true,
                        'str' => true,
                        'tuple' => true,
                        'type' => true,
                        'unichr' => true,
                        'unicode' => true,
                        'vars' => true,
                        'xrange' => true,
                        'zip' => true,
                    ),
                ),
            ),
            'blocks' => 
            array (
                'escaped' => 
                array (
                    'name' => 'escaped',
                    'case' => false,
                    'innerColor' => 'special',
                    'match' => '/\\\\./i',
                    'multiline' => false,
                ),
                'possiblefunction' => 
                array (
                    'name' => 'possiblefunction',
                    'case' => false,
                    'innerColor' => 'identifier',
                    'match' => '/[a-z_]\\w*(?=\\s*\\()/i',
                    'multiline' => false,
                ),
                'identifier' => 
                array (
                    'name' => 'identifier',
                    'case' => false,
                    'innerColor' => 'identifier',
                    'match' => '/[a-z_]\\w*/i',
                    'multiline' => false,
                ),
                'exponent' => 
                array (
                    'name' => 'exponent',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/((\\d+|((\\d*\\.\\d+)|(\\d+\\.\\d*)))[eE][+-]?\\d+)/i',
                    'multiline' => false,
                ),
                'imaginary' => 
                array (
                    'name' => 'imaginary',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/((\\d*\\.\\d+)|(\\d+\\.\\d*)|(\\d+))j/i',
                    'multiline' => false,
                ),
                'float' => 
                array (
                    'name' => 'float',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/(\\d*\\.\\d+)|(\\d+\\.\\d*)/i',
                    'multiline' => false,
                ),
                'integer' => 
                array (
                    'name' => 'integer',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/\\d+l?|\\b0l?\\b/i',
                    'multiline' => false,
                ),
                'hexinteger' => 
                array (
                    'name' => 'hexinteger',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/0[xX][\\da-f]+l?/i',
                    'multiline' => false,
                ),
                'octinteger' => 
                array (
                    'name' => 'octinteger',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/0[0-7]+l?/i',
                    'multiline' => false,
                ),
                'comment' => 
                array (
                    'name' => 'comment',
                    'case' => false,
                    'innerColor' => 'comment',
                    'match' => '/#.+/i',
                    'multiline' => false,
                ),
            ),
            'toplevel' => 
            array (
                'blocks' => 
                array (
                    0 => 'possiblefunction',
                    1 => 'identifier',
                    2 => 'exponent',
                    3 => 'imaginary',
                    4 => 'float',
                    5 => 'integer',
                    6 => 'hexinteger',
                    7 => 'octinteger',
                    8 => 'comment',
                ),
                'regions' => 
                array (
                    0 => 'strsingle3',
                    1 => 'strdouble3',
                    2 => 'strdouble',
                    3 => 'strsingle',
                    4 => 'brackets',
                    5 => 'sqbrackets',
                ),
            ),
            'case' => false,
            'defcolor' => 'code',
        );

        parent::_init($options);
    }
}

?>
Return current item: Content*Builder