Commit 7af9c9bf233224b8bc7208eaafaac33b82c8ea1e

aviaryan 2015-06-19T12:12:27

fixed bug with hexa numbers highlighting in python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/components/prism-python.js b/components/prism-python.js
index 33bebb9..b2e031f 100644
--- a/components/prism-python.js
+++ b/components/prism-python.js
@@ -10,7 +10,7 @@ Prism.languages.python= {
 	},
 	'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[box])?(?:[\da-f]+\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,
+	'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' : /[{}[\];(),.:]/
 };
\ No newline at end of file