web/wp-includes/js/codepress/languages/ruby.js
changeset 136 bde1974c263b
equal deleted inserted replaced
135:53cff4b4a802 136:bde1974c263b
       
     1 /*
       
     2  * CodePress regular expressions for Perl syntax highlighting
       
     3  */
       
     4 
       
     5 // Ruby
       
     6 Language.syntax = [
       
     7 	{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote 
       
     8 	{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
       
     9 	{ input : /([\$\@\%]+)([\w\.]*)/g, output : '<a>$1$2</a>' }, // vars
       
    10 	{ input : /(def\s+)([\w\.]*)/g, output : '$1<em>$2</em>' }, // functions
       
    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
       
    12 	{ input  : /([\(\){}])/g, output : '<u>$1</u>' }, // special chars
       
    13 	{ input  : /#(.*?)(<br>|<\/P>)/g, output : '<i>#$1</i>$2' } // comments
       
    14 ];
       
    15 
       
    16 Language.snippets = []
       
    17 
       
    18 Language.complete = [
       
    19 	{ input : '\'',output : '\'$0\'' },
       
    20 	{ input : '"', output : '"$0"' },
       
    21 	{ input : '(', output : '\($0\)' },
       
    22 	{ input : '[', output : '\[$0\]' },
       
    23 	{ input : '{', output : '{\n\t$0\n}' }		
       
    24 ]
       
    25 
       
    26 Language.shortcuts = []