1 /***************************************************************************
\r
2 * (c) 2008 - file created by Christoph Pinkel, MTC Infomedia OHG.
\r
4 * You may choose any license of the current release or any future release
\r
5 * of editarea to use, modify and/or redistribute this file.
\r
7 * This language specification file supports for syntax checking on
\r
8 * a large subset of Perl 5.x.
\r
9 * The basic common syntax of Perl is fully supported, but as for
\r
10 * the highlighting of built-in operations, it's mainly designed
\r
11 * to support for hightlighting Perl code in a Safe environment (compartment)
\r
12 * as used by CoMaNet for evaluation of administrative scripts. This Safe
\r
13 * compartment basically allows for all of Opcode's :default operations,
\r
14 * but little others. See http://perldoc.perl.org/Opcode.html to learn
\r
16 ***************************************************************************/
\r
18 editAreaLoader.load_syntax["perl"] = {
\r
20 'COMMENT_SINGLE' : {1 : '#'},
\r
21 'QUOTEMARKS' : {1: "'", 2: '"'},
\r
22 'KEYWORD_CASE_SENSITIVE' : true,
\r
26 [ "if", "else", "elsif", "while", "for", "each", "foreach",
\r
27 "next", "last", "goto", "exists", "delete", "undef",
\r
28 "my", "our", "local", "use", "require", "package", "keys", "values",
\r
29 "sub", "bless", "ref", "return" ],
\r
33 "int", "hex", "oct", "abs", "substr", "vec", "study", "pos",
\r
34 "length", "index", "rindex", "ord", "chr", "ucfirst", "lcfirst",
\r
35 "uc", "lc", "quotemeta", "chop", "chomp", "split", "list", "splice",
\r
36 "push", "pop", "shift", "unshift", "reverse", "and", "or", "dor",
\r
37 "xor", "warn", "die", "prototype",
\r
39 "concat", "repeat", "join", "range",
\r
40 //none from :base_loop, as we'll see them as basic statements...
\r
42 "sprintf", "crypt", "tie", "untie", "select", "localtime", "gmtime",
\r
44 "print", "open", "close"
\r
48 [ '+', '-', '/', '*', '=', '<', '>', '!', '||', '.', '&&',
\r
49 ' eq ', ' ne ', '=~' ],
\r
51 [ '(', ')', '[', ']', '{', '}' ],
\r
54 'packagedecl' : { 'search': '(package )([^ \r\n\t#;]*)()',
\r
55 'class' : 'scopingnames',
\r
56 'modifiers' : 'g', 'execute' : 'before' },
\r
57 'subdecl' : { 'search': '(sub )([^ \r\n\t#]*)()',
\r
58 'class' : 'scopingnames',
\r
59 'modifiers' : 'g', 'execute' : 'before' },
\r
60 'scalars' : { 'search': '()(\\\$[a-zA-Z0-9_:]*)()',
\r
62 'modifiers' : 'g', 'execute' : 'after' },
\r
63 'arrays' : { 'search': '()(@[a-zA-Z0-9_:]*)()',
\r
65 'modifiers' : 'g', 'execute' : 'after' },
\r
66 'hashs' : { 'search': '()(%[a-zA-Z0-9_:]*)()',
\r
68 'modifiers' : 'g', 'execute' : 'after' },
\r
73 'COMMENTS': 'color: #AAAAAA;',
\r
74 'QUOTESMARKS': 'color: #DC0000;',
\r
77 'core' : 'color: #8aca00;',
\r
78 'functions' : 'color: #2B60FF;'
\r
80 'OPERATORS' : 'color: #8aca00;',
\r
81 'DELIMITERS' : 'color: #0038E1;',
\r
84 'scopingnames' : 'color: #ff0000;',
\r
85 'vars' : 'color: #00aaaa;',
\r