You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
670 B
43 lines
670 B
|
3 years ago
|
module.exports = function(hljs) {
|
||
|
|
|
||
|
|
var COMMENT = {
|
||
|
|
className: 'comment',
|
||
|
|
begin: /\$noop\(/,
|
||
|
|
end: /\)/,
|
||
|
|
contains: [{
|
||
|
|
begin: /\(/,
|
||
|
|
end: /\)/,
|
||
|
|
contains: ['self', {
|
||
|
|
begin: /\\./
|
||
|
|
}]
|
||
|
|
}],
|
||
|
|
relevance: 10
|
||
|
|
};
|
||
|
|
|
||
|
|
var FUNCTION = {
|
||
|
|
className: 'keyword',
|
||
|
|
begin: /\$(?!noop)[a-zA-Z][_a-zA-Z0-9]*/,
|
||
|
|
end: /\(/,
|
||
|
|
excludeEnd: true
|
||
|
|
};
|
||
|
|
|
||
|
|
var VARIABLE = {
|
||
|
|
className: 'variable',
|
||
|
|
begin: /%[_a-zA-Z0-9:]*/,
|
||
|
|
end: '%'
|
||
|
|
};
|
||
|
|
|
||
|
|
var ESCAPE_SEQUENCE = {
|
||
|
|
className: 'symbol',
|
||
|
|
begin: /\\./
|
||
|
|
};
|
||
|
|
|
||
|
|
return {
|
||
|
|
contains: [
|
||
|
|
COMMENT,
|
||
|
|
FUNCTION,
|
||
|
|
VARIABLE,
|
||
|
|
ESCAPE_SEQUENCE
|
||
|
|
]
|
||
|
|
};
|
||
|
|
};
|