python_repl function

Mode python_repl(
  1. Highlight hljs
)

Highlight.js language definition for python-repl.

Implementation

Mode python_repl(Highlight hljs) {
  return Mode(
    aliases: [r'pycon'],
    contains: [
      Mode(
        scope: r'meta.prompt',
        starts: Mode(
          end: r' |$',
          starts: Mode(end: r'$', subLanguage: r'python'),
        ),
        variants: [
          Mode(begin: r'^>>>(?=[ ]|$)'),
          Mode(begin: r'^\.\.\.(?=[ ]|$)'),
        ],
      ),
    ],
  );
}