~didrocks/+junk/face-detection-15.04

« back to all changes in this revision

Viewing changes to facedetection/www/bower_components/prism/components/prism-python.js

  • Committer: Didier Roche
  • Date: 2016-05-10 23:09:11 UTC
  • Revision ID: didier.roche@canonical.com-20160510230911-c7xr490zrj3yrzxd
New version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Prism.languages.python= {
 
2
        'triple-quoted-string': {
 
3
                pattern: /"""[\s\S]+?"""|'''[\s\S]+?'''/,
 
4
                alias: 'string'
 
5
        },
 
6
        'comment': {
 
7
                pattern: /(^|[^\\])#.*/,
 
8
                lookbehind: true
 
9
        },
 
10
        'string': /("|')(?:\\?.)*?\1/,
 
11
        'function' : {
 
12
                pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,
 
13
                lookbehind: true
 
14
        },
 
15
        'class-name': {
 
16
                pattern: /(\bclass\s+)[a-z0-9_]+/i,
 
17
                lookbehind: true
 
18
        },
 
19
        'keyword' : /\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,
 
20
        'boolean' : /\b(?:True|False)\b/,
 
21
        'number' : /\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,
 
22
        'operator' : /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,
 
23
        'punctuation' : /[{}[\];(),.:]/
 
24
};