premier commit
[bazdig.git] / bazdig / codepress / languages / ruby.js
blob860f43381ac57fd841a02852ce121e30eac4c040
1 /*\r
2  * CodePress regular expressions for Perl syntax highlighting\r
3  */\r
4 \r
5 // Ruby\r
6 Language.syntax = [\r
7         { input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote \r
8         { input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote\r
9         { input : /([\$\@\%]+)([\w\.]*)/g, output : '<a>$1$2</a>' }, // vars\r
10         { input : /(def\s+)([\w\.]*)/g, output : '$1<em>$2</em>' }, // functions\r
11         { 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, output : '<b>$1</b>' }, // reserved words\r
12         { input  : /([\(\){}])/g, output : '<u>$1</u>' }, // special chars\r
13         { input  : /#(.*?)(<br>|<\/P>)/g, output : '<i>#$1</i>$2' } // comments\r
14 ];\r
16 Language.snippets = []\r
18 Language.complete = [\r
19         { input : '\'',output : '\'$0\'' },\r
20         { input : '"', output : '"$0"' },\r
21         { input : '(', output : '\($0\)' },\r
22         { input : '[', output : '\[$0\]' },\r
23         { input : '{', output : '{\n\t$0\n}' }          \r
24 ]\r
26 Language.shortcuts = []\r