UNPKG

692 BJavaScriptView Raw
1/*
2Language: Python REPL
3Requires: python.js
4Author: Josh Goebel <hello@joshgoebel.com>
5Category: common
6*/
7
8function pythonRepl(hljs) {
9 return {
10 aliases: [ 'pycon' ],
11 contains: [
12 {
13 className: 'meta',
14 starts: {
15 // a space separates the REPL prefix from the actual code
16 // this is purely for cleaner HTML output
17 end: / |$/,
18 starts: {
19 end: '$',
20 subLanguage: 'python'
21 }
22 },
23 variants: [
24 {
25 begin: /^>>>(?=[ ]|$)/
26 },
27 {
28 begin: /^\.\.\.(?=[ ]|$)/
29 }
30 ]
31 }
32 ]
33 };
34}
35
36export { pythonRepl as default };