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