profile.js 847 B

1234567891011121314151617181920212223242526272829303132333435363738
  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}', end: ':',
  13. excludeEnd: true
  14. },
  15. {
  16. begin: '(ncalls|tottime|cumtime)', end: '$',
  17. keywords: 'ncalls tottime|10 cumtime|10 filename',
  18. relevance: 10
  19. },
  20. {
  21. begin: 'function calls', end: '$',
  22. contains: [hljs.C_NUMBER_MODE],
  23. relevance: 10
  24. },
  25. hljs.APOS_STRING_MODE,
  26. hljs.QUOTE_STRING_MODE,
  27. {
  28. className: 'string',
  29. begin: '\\(', end: '\\)$',
  30. excludeBegin: true, excludeEnd: true,
  31. relevance: 0
  32. }
  33. ]
  34. };
  35. }
  36. module.exports = profile;