~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/media/common/codepress/languages/generic.js

  • Committer: William Grant
  • Date: 2008-07-07 01:45:11 UTC
  • mfrom: (unknown (missing))
  • Revision ID: wgrant@ugrad.unimelb.edu.au-20080707014511-xyy43p6y8jiqrsh9
Merge killall-editarea branch. We now use CodePress instead, which is
somewhat less slothful.

Show diffs side-by-side

added added

removed removed

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