premier commit
[bazdig.git] / bazdig / codepress / languages / generic.js
blob8289da083595fe06ff35123a0da7464252bcacfc
1 /*\r
2  * CodePress regular expressions for generic syntax highlighting\r
3  */\r
4  \r
5 // generic languages\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 : /\b(abstract|continue|for|new|switch|default|goto|boolean|do|if|private|this|break|double|protected|throw|byte|else|import|public|throws|case|return|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|const|float|while|function|label)\b/g, output : '<b>$1</b>' }, // reserved words\r
10         { input : /([\(\){}])/g, output : '<em>$1</em>' }, // special chars;\r
11         { input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // comments //\r
12         { input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' } // comments /* */\r
13 ]\r
15 Language.snippets = []\r
17 Language.complete = [\r
18         { input : '\'', output : '\'$0\'' },\r
19         { input : '"', output : '"$0"' },\r
20         { input : '(', output : '\($0\)' },\r
21         { input : '[', output : '\[$0\]' },\r
22         { input : '{', output : '{\n\t$0\n}' }          \r
23 ]\r
25 Language.shortcuts = []\r