leaf.js 860 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. module.exports = function (hljs) {
  2. return {
  3. contains: [
  4. {
  5. className: 'function',
  6. begin: '#+' + '[A-Za-z_0-9]*' + '\\(',
  7. end:' {',
  8. returnBegin: true,
  9. excludeEnd: true,
  10. contains : [
  11. {
  12. className: 'keyword',
  13. begin: '#+'
  14. },
  15. {
  16. className: 'title',
  17. begin: '[A-Za-z_][A-Za-z_0-9]*'
  18. },
  19. {
  20. className: 'params',
  21. begin: '\\(', end: '\\)',
  22. endsParent: true,
  23. contains: [
  24. {
  25. className: 'string',
  26. begin: '"',
  27. end: '"'
  28. },
  29. {
  30. className: 'variable',
  31. begin: '[A-Za-z_][A-Za-z_0-9]*'
  32. }
  33. ]
  34. }
  35. ]
  36. }
  37. ]
  38. };
  39. };