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

« back to all changes in this revision

Viewing changes to www/media/common/codepress/languages/python.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 Python syntax highlighting
 
3
 */
 
4
 
 
5
// Python
 
6
Language.syntax = [ 
 
7
        { input : /(\'\'\')(.*?)(\'\'\')/mg, output : '<s>$1$2$3</s>' }, // strings triple-single quote
 
8
        { input : /(\"\"\")(.*?)(\"\"\")/mg, output : '<s>$1$2$3</s>' }, // strings triple-single quote
 
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(break|continue|del|except|exec|finally|pass|print|raise|return|try|with|global|assert|lambda|yield|def|class|for|while|if|elif|else|and|in|is|not|or|import|from|as)\b/g, output : '<b>$1</b>' }, // reserved words
 
12
        { input : /\b(True|False|bool|enumerate|set|frozenset|help|reversed|sorted|sum|Ellipsis|None|NotImplemented|__import__|abs|apply|buffer|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|eval|execfile|file|filter|float|getattr|globals|hasattr|hash|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|min|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|round|setattr|slice|staticmethod|str|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/g, output : '<u>$1</u>' }, // special words
 
13
        { input : /([^:]|^)#(.*?)(<br|<\/P)/g, output : '$1<i>#$2</i>$3' }, // comments //
 
14
]
 
15
 
 
16
Language.snippets = [
 
17
]
 
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 = []