plugins/geshi/geshi/perl.php
changeset 3 f3e2bbbd2155
parent 2 9e3258dfae15
equal deleted inserted replaced
2:9e3258dfae15 3:f3e2bbbd2155
     2 /*************************************************************************************
     2 /*************************************************************************************
     3  * perl.php
     3  * perl.php
     4  * --------
     4  * --------
     5  * Author: Andreas Gohr (andi@splitbrain.org), Ben Keen (ben.keen@gmail.com)
     5  * Author: Andreas Gohr (andi@splitbrain.org), Ben Keen (ben.keen@gmail.com)
     6  * Copyright: (c) 2004 Andreas Gohr, Ben Keen (http://www.benjaminkeen.org/), Nigel McNie (http://qbnz.com/highlighter/)
     6  * Copyright: (c) 2004 Andreas Gohr, Ben Keen (http://www.benjaminkeen.org/), Nigel McNie (http://qbnz.com/highlighter/)
     7  * Release Version: 1.0.8.2
     7  * Release Version: 1.0.8.4
     8  * Date Started: 2004/08/20
     8  * Date Started: 2004/08/20
     9  *
     9  *
    10  * Perl language file for GeSHi.
    10  * Perl language file for GeSHi.
    11  *
    11  *
    12  * CHANGES
    12  * CHANGES
    70         //Regular expression match variables
    70         //Regular expression match variables
    71         3 => '/\$\d+/',
    71         3 => '/\$\d+/',
    72         //Heredoc
    72         //Heredoc
    73         4 => '/<<\s*?([\'"]?)([a-zA-Z0-9]+)\1;[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
    73         4 => '/<<\s*?([\'"]?)([a-zA-Z0-9]+)\1;[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
    74         //Predefined variables
    74         //Predefined variables
    75         5 => '/\$(\^[a-zA-Z]?|[\$`\'&_\.,+\-~:\\\\\/"\|%=\?!@<>\(\)\[\]])|@_/',
    75         5 => '/\$(\^[a-zA-Z]?|[\*\$`\'&_\.,+\-~:;\\\\\/"\|%=\?!@#<>\(\)\[\]])(?!\w)|@[_+\-]|%[!]|\$(?=\{)/',
    76         ),
    76         ),
    77     'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
    77     'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
    78     'QUOTEMARKS' => array('"','`'),
    78     'QUOTEMARKS' => array('"','`'),
    79     'HARDQUOTE' => array("'", "'"),            // An optional 2-element array defining the beginning and end of a hard-quoted string
    79     'HARDQUOTE' => array("'", "'"),            // An optional 2-element array defining the beginning and end of a hard-quoted string
    80     'HARDESCAPE' => array('\\\'',),
    80     'HARDESCAPE' => array('\\\'',),
    84         // QUOTEMARKS array or is the ESCAPE_CHAR
    84         // QUOTEMARKS array or is the ESCAPE_CHAR
    85     'ESCAPE_CHAR' => '\\',
    85     'ESCAPE_CHAR' => '\\',
    86     'KEYWORDS' => array(
    86     'KEYWORDS' => array(
    87         1 => array(
    87         1 => array(
    88             'case', 'do', 'else', 'elsif', 'for', 'if', 'then', 'until', 'while', 'foreach', 'my',
    88             'case', 'do', 'else', 'elsif', 'for', 'if', 'then', 'until', 'while', 'foreach', 'my',
    89             'or', 'and', 'unless', 'next', 'last', 'redo', 'not', 'our',
    89             'xor', 'or', 'and', 'unless', 'next', 'last', 'redo', 'not', 'our',
    90             'reset', 'continue', 'cmp', 'ne'
    90             'reset', 'continue', 'cmp', 'ne', 'eq', 'lt', 'gt', 'le', 'ge',
    91             ),
    91             ),
    92         2 => array(
    92         2 => array(
    93             'use', 'sub', 'new', '__END__', '__DATA__', '__DIE__', '__WARN__', 'BEGIN',
    93             'use', 'sub', 'new', '__END__', '__DATA__', '__DIE__', '__WARN__', 'BEGIN',
    94             'STDIN', 'STDOUT', 'STDERR'
    94             'STDIN', 'STDOUT', 'STDERR', 'ARGV', 'ARGVOUT'
    95             ),
    95             ),
    96         3 => array(
    96         3 => array(
    97             'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless',
    97             'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless',
    98             'caller', 'chdir', 'chmod', 'chomp', 'chop', 'chown', 'chr',
    98             'caller', 'chdir', 'chmod', 'chomp', 'chop', 'chown', 'chr',
    99             'chroot', 'close', 'closedir', 'connect', 'cos',
    99             'chroot', 'close', 'closedir', 'connect', 'cos',
   128             'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write', 'y'
   128             'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write', 'y'
   129             )
   129             )
   130         ),
   130         ),
   131     'SYMBOLS' => array(
   131     'SYMBOLS' => array(
   132         '<', '>', '=',
   132         '<', '>', '=',
   133         '!', '@', '~', '&', '|',
   133         '!', '@', '~', '&', '|', '^',
   134         '+','-', '*', '/', '%',
   134         '+','-', '*', '/', '%',
   135         ',', ';', '?', ':'
   135         ',', ';', '?', '.', ':'
   136         ),
   136         ),
   137     'CASE_SENSITIVE' => array(
   137     'CASE_SENSITIVE' => array(
   138         GESHI_COMMENTS => false,
   138         GESHI_COMMENTS => false,
   139         1 => true,
   139         1 => true,
   140         2 => true,
   140         2 => true,
   192         1 => '-&gt;',
   192         1 => '-&gt;',
   193         2 => '::'
   193         2 => '::'
   194         ),
   194         ),
   195     'REGEXPS' => array(
   195     'REGEXPS' => array(
   196         //Variable
   196         //Variable
   197         0 => '[\\$%@]+[a-zA-Z_][a-zA-Z0-9_]*',
   197         0 => '(?:\$[\$#]?|\\\\(?:[@%*]?|\\\\*\$|&amp;)|%[$]?|@[$]?|\*[$]?|&amp;[$]?)[a-zA-Z_][a-zA-Z0-9_]*',
   198         //File Descriptor
   198         //File Descriptor
   199         4 => '&lt;[a-zA-Z_][a-zA-Z0-9_]*&gt;',
   199         4 => '&lt;[a-zA-Z_][a-zA-Z0-9_]*&gt;',
   200         ),
   200         ),
   201     'STRICT_MODE_APPLIES' => GESHI_NEVER,
   201     'STRICT_MODE_APPLIES' => GESHI_NEVER,
   202     'SCRIPT_DELIMITERS' => array(
   202     'SCRIPT_DELIMITERS' => array(