Podświetlanie składni w edytorze XML dzięki editArea. Closes #17. Niestety dla tekstó...
[redakcja.git] / project / static / js / reg_syntax / perl.js
1 /***************************************************************************\r
2  * (c) 2008 - file created by Christoph Pinkel, MTC Infomedia OHG.\r
3  *\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
6  *\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
15  * more.\r
16  ***************************************************************************/\r
17 \r
18 editAreaLoader.load_syntax["perl"] = {\r
19 \r
20         'COMMENT_SINGLE' : {1 : '#'},\r
21         'QUOTEMARKS' : {1: "'", 2: '"'},\r
22         'KEYWORD_CASE_SENSITIVE' : true,\r
23         'KEYWORDS' :\r
24         {\r
25                 'core' :\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
30                 'functions' :\r
31                         [\r
32                                 //from :base_core\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
38                                 //from :base_mem\r
39                                 "concat", "repeat", "join", "range",\r
40                                 //none from :base_loop, as we'll see them as basic statements...\r
41                                 //from :base_orig\r
42                                 "sprintf", "crypt", "tie", "untie", "select", "localtime", "gmtime",\r
43                                 //others\r
44                                 "print", "open", "close"\r
45                         ]\r
46         },\r
47         'OPERATORS' :\r
48                 [ '+', '-', '/', '*', '=', '<', '>', '!', '||', '.', '&&',\r
49                         ' eq ', ' ne ', '=~' ],\r
50         'DELIMITERS' :\r
51                 [ '(', ')', '[', ']', '{', '}' ],\r
52         'REGEXPS' :\r
53         {\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
61                         'class' : 'vars',\r
62                         'modifiers' : 'g', 'execute' : 'after' },\r
63                 'arrays' : { 'search': '()(@[a-zA-Z0-9_:]*)()',\r
64                         'class' : 'vars',\r
65                         'modifiers' : 'g', 'execute' : 'after' },\r
66                 'hashs' : { 'search': '()(%[a-zA-Z0-9_:]*)()',\r
67                         'class' : 'vars',\r
68                         'modifiers' : 'g', 'execute' : 'after' },\r
69         },\r
70 \r
71         'STYLES' :\r
72         {\r
73                 'COMMENTS': 'color: #AAAAAA;',\r
74                 'QUOTESMARKS': 'color: #DC0000;',\r
75                 'KEYWORDS' :\r
76                 {\r
77                         'core' : 'color: #8aca00;',\r
78                         'functions' : 'color: #2B60FF;'\r
79                 },\r
80                 'OPERATORS' : 'color: #8aca00;',\r
81                 'DELIMITERS' : 'color: #0038E1;',\r
82                 'REGEXPS':\r
83                 {\r
84                         'scopingnames' : 'color: #ff0000;',\r
85                         'vars' : 'color: #00aaaa;',\r
86                 }\r
87         } //'STYLES'\r
88 };\r