1
|
/*
|
2
|
* CodePress regular expressions for Perl syntax highlighting
|
3
|
*/
|
4
|
|
5
|
Language.syntax = [ // Ruby
|
6
|
{
|
7
|
input : /\"(.*?)(\"|<br>|<\/P>)/g,
|
8
|
output : '<s>"$1$2</s>', // strings double quote
|
9
|
},{
|
10
|
input : /\'(.*?)(\'|<br>|<\/P>)/g,
|
11
|
output : '<s>\'$1$2</s>', // strings single quote
|
12
|
},{
|
13
|
input : /([\$\@\%]+)([\w\.]*)/g,
|
14
|
output : '<a>$1$2</a>', // vars
|
15
|
},{
|
16
|
input : /(def\s+)([\w\.]*)/g,
|
17
|
output : '$1<em>$2</em>', // functions
|
18
|
},{
|
19
|
input : /\b(alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\b/g,
|
20
|
output : '<b>$1</b>', // reserved words
|
21
|
},{
|
22
|
input : /([\(\){}])/g,
|
23
|
output : '<u>$1</u>', // special chars
|
24
|
},{
|
25
|
input : /#(.*?)(<br>|<\/P>)/g,
|
26
|
output : '<i>#$1</i>$2' // comments
|
27
|
}
|
28
|
];
|
29
|
|
30
|
Language.snippets = [];
|
31
|
|
32
|
Language.complete = [ // Auto complete only for 1 character
|
33
|
{input : '\'',output : '\'$0\'' },
|
34
|
{input : '"', output : '"$0"' },
|
35
|
{input : '(', output : '\($0\)' },
|
36
|
{input : '[', output : '\[$0\]' },
|
37
|
{input : '{', output : '{\n\t$0\n}' }
|
38
|
];
|
39
|
|
40
|
Language.shortcuts = [];
|