node-repl.js 711 B

12345678910111213141516171819202122232425262728293031323334353637
  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',
  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. {
  25. begin: /^>(?=[ ]|$)/
  26. },
  27. {
  28. begin: /^\.\.\.(?=[ ]|$)/
  29. }
  30. ]
  31. }
  32. ]
  33. };
  34. }
  35. module.exports = nodeRepl;