flix.js 1008 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. module.exports = function (hljs) {
  2. var CHAR = {
  3. className: 'string',
  4. begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/
  5. };
  6. var STRING = {
  7. className: 'string',
  8. variants: [
  9. {
  10. begin: '"', end: '"'
  11. }
  12. ]
  13. };
  14. var NAME = {
  15. className: 'title',
  16. begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/
  17. };
  18. var METHOD = {
  19. className: 'function',
  20. beginKeywords: 'def',
  21. end: /[:={\[(\n;]/,
  22. excludeEnd: true,
  23. contains: [NAME]
  24. };
  25. return {
  26. keywords: {
  27. literal: 'true false',
  28. keyword: 'case class def else enum if impl import in lat rel index let match namespace switch type yield with'
  29. },
  30. contains: [
  31. hljs.C_LINE_COMMENT_MODE,
  32. hljs.C_BLOCK_COMMENT_MODE,
  33. CHAR,
  34. STRING,
  35. METHOD,
  36. hljs.C_NUMBER_MODE
  37. ]
  38. };
  39. };