Project

General

Profile

1
/*
2
 * CodePress regular expressions for generic syntax highlighting
3
 */
4
 
5
Language.syntax = [ // generic languages
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 : /\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,
14
	output : '<b>$1</b>' // reserved words
15
	},{
16
	input : /([\(\){}])/g,
17
	output : '<em>$1</em>' // special chars;
18
	},{
19
	input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g,
20
	output : '$1<i>//$2</i>$3' // comments //
21
	},{
22
	input : /\/\*(.*?)\*\//g,
23
	output : '<i>/*$1*/</i>' // comments /* */
24
	}
25
];
26

    
27
Language.snippets = [];
28

    
29
Language.complete = [ // Auto complete only for 1 character
30
	{input : '\'', output : '\'$0\'' },
31
	{input : '"', output : '"$0"' },
32
	{input : '(', output : '\($0\)' },
33
	{input : '[', output : '\[$0\]' },
34
	{input : '{', output : '{\n\t$0\n}' }		
35
]
36

    
37
Language.shortcuts = [];
(4-4/20)