mirror of
https://github.com/arsenetar/PrismHighlight.git
synced 2024-11-24 04:39:01 +00:00
15 lines
567 B
JavaScript
15 lines
567 B
JavaScript
|
Prism.languages.python= {
|
||
|
'comment': {
|
||
|
pattern: /(^|[^\\])#.*?(\r?\n|$)/g,
|
||
|
lookbehind: true
|
||
|
},
|
||
|
'string' : /("|')(\\?.)*?\1/g,
|
||
|
'keyword' : /\b(as|assert|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/g,
|
||
|
'boolean' : /\b(True|False)\b/g,
|
||
|
'number' : /\b-?(0x)?\d*\.?[\da-f]+\b/g,
|
||
|
'operator' : /[-+]{1,2}|=?<|=?>|!|={1,2}|(&){1,2}|(&){1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/g,
|
||
|
'ignore' : /&(lt|gt|amp);/gi,
|
||
|
'punctuation' : /[{}[\];(),.:]/g
|
||
|
};
|
||
|
|