You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
856 B
JavaScript
33 lines
856 B
JavaScript
Prism.languages.clike = {
|
|
'comment': [
|
|
{
|
|
pattern: /(^|[^\\])\/\*[\w\W]*?\*\//g,
|
|
lookbehind: true
|
|
},
|
|
{
|
|
pattern: /(^|[^\\:])\/\/.*?(\r?\n|$)/g,
|
|
lookbehind: true
|
|
}
|
|
],
|
|
'string': /("|')(\\\n|\\?.)*?\1/g,
|
|
'class-name': {
|
|
pattern: /((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,
|
|
lookbehind: true,
|
|
inside: {
|
|
punctuation: /(\.|\\)/
|
|
}
|
|
},
|
|
'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/g,
|
|
'boolean': /\b(true|false)\b/g,
|
|
'function': {
|
|
pattern: /[a-z0-9_]+\(/ig,
|
|
inside: {
|
|
punctuation: /\(/
|
|
}
|
|
},
|
|
'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,
|
|
'operator': /[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/g,
|
|
'ignore': /&(lt|gt|amp);/gi,
|
|
'punctuation': /[{}[\];(),.:]/g
|
|
};
|