prism-python.js 563 B

12345678910111213
  1. Prism.languages.python= {
  2. 'comment': {
  3. pattern: /(^|[^\\])#.*?(\r?\n|$)/,
  4. lookbehind: true
  5. },
  6. 'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/,
  7. '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/,
  8. 'boolean' : /\b(True|False)\b/,
  9. 'number' : /\b-?(0[box])?(?:[\da-f]+\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,
  10. 'operator' : /[-+]|<=?|>=?|!|={1,2}|&{1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/,
  11. 'punctuation' : /[{}[\];(),.:]/
  12. };