1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/*
Language: Python profile
Description: Python profiler results
Author: Brian Beck <exogen@gmail.com>
*/
this.lang = function(hljs){
hljs.LANGUAGES.profile = {
defaultMode: {
lexems: [hljs.UNDERSCORE_IDENT_RE],
contains: ['number', 'builtin', 'filename', 'header', 'summary', 'string', 'function']
},
modes: [
hljs.C_NUMBER_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'summary',
begin: 'function calls', end: '$',
contains: ['number'],
relevance: 10
},
{
className: 'header',
begin: '(ncalls|tottime|cumtime)', end: '$',
lexems: [hljs.IDENT_RE],
keywords: {'ncalls': 1, 'tottime': 10, 'cumtime': 10, 'filename': 1},
relevance: 10
},
{
className: 'function',
begin: '\\(', end: '\\)',
lexems: [hljs.UNDERSCORE_IDENT_RE],
contains: ['title']
},
{
className: 'title',
begin: hljs.UNDERSCORE_IDENT_RE, end: '^'
},
{
className: 'builtin',
begin: '{', end: '}',
contains: ['string'],
excludeBegin: true, excludeEnd: true
},
{
className: 'filename',
begin: '(/\w|[a-zA-Z_][\da-zA-Z_]+\\.[\da-zA-Z_]{1,3})', end: ':',
excludeEnd: true
}
]
};
};
|