~fusonic/chive/1.1

« back to all changes in this revision

Viewing changes to protected/extensions/CodePress/codepress/languages/generic.js

  • Committer: Matthias Burtscher
  • Date: 2010-02-12 09:12:35 UTC
  • Revision ID: matthias.burtscher@fusonic.net-20100212091235-jqxrb62klx872ajc
* Updated Yii to 1.1.0
* Removed CodePress and CodeMirror
* Updated jQuery and some plugins
* Cleaned some code ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * CodePress regular expressions for generic syntax highlighting
3
 
 */
4
 
 
5
 
var Language = new Object();
6
 
 
7
 
// generic languages
8
 
Language.syntax = [
9
 
        { input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
10
 
        { input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
11
 
        { 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
12
 
        { input : /([\(\){}])/g, output : '<em>$1</em>' }, // special chars;
13
 
        { input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // comments //
14
 
        { input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' } // comments /* */
15
 
]
16
 
 
17
 
Language.snippets = []
18
 
 
19
 
Language.complete = [
20
 
        { input : '\'', output : '\'$0\'' },
21
 
        { input : '"', output : '"$0"' },
22
 
        { input : '(', output : '\($0\)' },
23
 
        { input : '[', output : '\[$0\]' },
24
 
        { input : '{', output : '{\n\t$0\n}' }          
25
 
]
26
 
 
27
 
Language.shortcuts = []