Project

General

Profile

1
/*
2
 * CodePress regular expressions for Java syntax highlighting
3
 */
4
 
5
Language.syntax = [ // Java
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|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/g,
14
	output : '<b>$1</b>' // reserved words
15
	},{
16
	input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g,
17
	output : '$1<i>//$2</i>$3' // comments //	
18
	},{
19
	input : /\/\*(.*?)\*\//g,
20
	output : '<i>/*$1*/</i>' // comments /* */
21
	}
22
];
23

    
24
Language.snippets = [];
25

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

    
34
Language.shortcuts = [];
(8-8/20)