Blame view

bower_components/prism/components/prism-python.js 674 Bytes
73bcce88   luigser   COMPONENTS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  Prism.languages.python= { 
  	'comment': {
  		pattern: /(^|[^\\])#.*?(\r?\n|$)/,
  		lookbehind: true
  	},
  	'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/,
  	'function' : {
  		pattern: /((^|\s)def[ \t]+)([a-zA-Z_][a-zA-Z0-9_]*(?=\())/g,
  		lookbehind: true
  	},
  	'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/,
  	'boolean' : /\b(True|False)\b/,
  	'number' : /\b-?(0[bo])?(?:(\d|0x[a-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,
  	'operator' : /[-+]|<=?|>=?|!|={1,2}|&{1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/,
  	'punctuation' : /[{}[\];(),.:]/
  };