node-repl.js 679 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. Language: Node REPL
  3. Requires: javascript.js
  4. Author: Marat Nagayev <nagaevmt@yandex.ru>
  5. Category: scripting
  6. */
  7. /** @type LanguageFn */
  8. function nodeRepl(hljs) {
  9. return {
  10. name: 'Node REPL',
  11. contains: [
  12. {
  13. className: 'meta.prompt',
  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: 'javascript'
  21. }
  22. },
  23. variants: [
  24. { begin: /^>(?=[ ]|$)/ },
  25. { begin: /^\.\.\.(?=[ ]|$)/ }
  26. ]
  27. }
  28. ]
  29. };
  30. }
  31. export { nodeRepl as default };