~didrocks/+junk/face-detection-15.04

« back to all changes in this revision

Viewing changes to facedetection/www/bower_components/prism/components/prism-stylus.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
(function (Prism) {
 
2
        var inside = {
 
3
                'url': /url\((["']?).*?\1\)/i,
 
4
                'string': /("|')(?:[^\\\r\n]|\\(?:\r\n|[\s\S]))*?\1/,
 
5
                'interpolation': null, // See below
 
6
                'func': null, // See below
 
7
                'important': /\B!(?:important|optional)\b/i,
 
8
                'keyword': {
 
9
                        pattern: /(^|\s+)(?:(?:if|else|for|return|unless)(?=\s+|$)|@[\w-]+)/,
 
10
                        lookbehind: true
 
11
                },
 
12
                'hexcode': /#[\da-f]{3,6}/i,
 
13
                'number': /\b\d+(?:\.\d+)?%?/,
 
14
                'boolean': /\b(?:true|false)\b/,
 
15
                'operator': [
 
16
                        // We want non-word chars around "-" because it is
 
17
                        // accepted in property names.
 
18
                        /~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.+|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/
 
19
                ],
 
20
                'punctuation': /[{}()\[\];:,]/
 
21
        };
 
22
 
 
23
        inside['interpolation'] = {
 
24
                pattern: /\{[^\r\n}:]+\}/,
 
25
                alias: 'variable',
 
26
                inside: Prism.util.clone(inside)
 
27
        };
 
28
        inside['func'] = {
 
29
                pattern: /[\w-]+\([^)]*\).*/,
 
30
                inside: {
 
31
                        'function': /^[^(]+/,
 
32
                        rest: Prism.util.clone(inside)
 
33
                }
 
34
        };
 
35
 
 
36
        Prism.languages.stylus = {
 
37
                'comment': {
 
38
                        pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*)/,
 
39
                        lookbehind: true
 
40
                },
 
41
                'atrule-declaration': {
 
42
                        pattern: /(^\s*)@.+/m,
 
43
                        lookbehind: true,
 
44
                        inside: {
 
45
                                'atrule': /^@[\w-]+/,
 
46
                                rest: inside
 
47
                        }
 
48
                },
 
49
                'variable-declaration': {
 
50
                        pattern: /(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:(?:\{[^}]*\}|.+)|$)/m,
 
51
                        lookbehind: true,
 
52
                        inside: {
 
53
                                'variable': /^\S+/,
 
54
                                rest: inside
 
55
                        }
 
56
                },
 
57
 
 
58
                'statement': {
 
59
                        pattern: /(^[ \t]*)(?:if|else|for|return|unless)[ \t]+.+/m,
 
60
                        lookbehind: true,
 
61
                        inside: {
 
62
                                keyword: /^\S+/,
 
63
                                rest: inside
 
64
                        }
 
65
                },
 
66
 
 
67
                // A property/value pair cannot end with a comma or a brace
 
68
                // It cannot have indented content unless it ended with a semicolon
 
69
                'property-declaration': {
 
70
                        pattern: /((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)[^{\r\n]*(?:;|[^{\r\n,](?=$)(?!(\r?\n|\r)(?:\{|\2[ \t]+)))/m,
 
71
                        lookbehind: true,
 
72
                        inside: {
 
73
                                'property': {
 
74
                                        pattern: /^[^\s:]+/,
 
75
                                        inside: {
 
76
                                                'interpolation': inside.interpolation
 
77
                                        }
 
78
                                },
 
79
                                rest: inside
 
80
                        }
 
81
                },
 
82
 
 
83
 
 
84
 
 
85
                // A selector can contain parentheses only as part of a pseudo-element
 
86
                // It can span multiple lines.
 
87
                // It must end with a comma or an accolade or have indented content.
 
88
                'selector': {
 
89
                        pattern: /(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t]+)))/m,
 
90
                        lookbehind: true,
 
91
                        inside: {
 
92
                                'interpolation': inside.interpolation,
 
93
                                'punctuation': /[{},]/
 
94
                        }
 
95
                },
 
96
 
 
97
                'func': inside.func,
 
98
                'string': inside.string,
 
99
                'interpolation': inside.interpolation,
 
100
                'punctuation': /[{}()\[\];:.]/
 
101
        };
 
102
}(Prism));
 
 
b'\\ No newline at end of file'