profile.js 889 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. Language: Python profiler
  3. Description: Python profiler results
  4. Author: Brian Beck <exogen@gmail.com>
  5. */
  6. function profile(hljs) {
  7. return {
  8. name: 'Python profiler',
  9. contains: [
  10. hljs.C_NUMBER_MODE,
  11. {
  12. begin: '[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}',
  13. end: ':',
  14. excludeEnd: true
  15. },
  16. {
  17. begin: '(ncalls|tottime|cumtime)',
  18. end: '$',
  19. keywords: 'ncalls tottime|10 cumtime|10 filename',
  20. relevance: 10
  21. },
  22. {
  23. begin: 'function calls',
  24. end: '$',
  25. contains: [ hljs.C_NUMBER_MODE ],
  26. relevance: 10
  27. },
  28. hljs.APOS_STRING_MODE,
  29. hljs.QUOTE_STRING_MODE,
  30. {
  31. className: 'string',
  32. begin: '\\(',
  33. end: '\\)$',
  34. excludeBegin: true,
  35. excludeEnd: true,
  36. relevance: 0
  37. }
  38. ]
  39. };
  40. }
  41. module.exports = profile;